Skip to contents

fine_gray() models the cumulative incidence of one cause with the proportional subdistribution hazards model of Fine and Gray. The subdistribution hazard of a subject with covariates \(x\) is \(h_0(t) \exp(x^\top \beta)\), and the cumulative incidence is $$F(t \mid x) = 1 - \exp\{-H_0(t) \exp(x^\top \beta)\}.$$ Each coefficient is a log subdistribution hazard ratio. A positive one means a higher cumulative incidence of the cause.

Usage

fine_gray(
  formula,
  data,
  cause = 1,
  subset,
  na.action = stats::na.omit,
  conf_level = 0.95,
  max_iter = 30,
  tol = 1e-09
)

Arguments

formula

A formula with a competing-risks Surv() response on the left (see aalen_johansen()) and the covariates on the right, such as Surv(time, event) ~ age + sex. Factors are coded with treatment contrasts.

data

A data frame holding the variables in formula.

cause

The cause to model, as a state name or as a number (1 for the first cause, the default).

subset

An optional expression selecting the rows of data to use.

na.action

What to do with rows that have missing values. The default drops them.

conf_level

The confidence level, between 0 and 1. The default is 0.95.

max_iter

The largest number of Newton-Raphson iterations. The default is 30.

tol

The convergence tolerance: iterations stop once the log partial likelihood changes by less than tol times its size. The default is 1e-9.

Value

A fine_gray object. Use as.data.frame() for the coefficient table, coef() and vcov() for the estimates and their robust variance, and predict() for linear predictors, relative subdistribution hazards, and cumulative incidence. The object also holds naive_var, loglik (at \(\beta = 0\) and at the estimate), baseline (the baseline cumulative subdistribution hazard at the event times of the cause, for covariates at their means), n, n_event, and cause.

Details

The coefficients maximize a weighted partial likelihood with Breslow's handling of ties. Subjects who had a competing event stay in the risk set after it, weighted by the Kaplan-Meier estimate of remaining uncensored at each later time divided by that at their own event time. Events of either kind are taken to happen just before any censoring tied with them. The standard errors are the robust (sandwich) ones, and the model-based variance is kept as naive_var.

References

Fine, J. P. and Gray, R. J. (1999). A proportional hazards model for the subdistribution of a competing risk. Journal of the American Statistical Association, 94(446), 496-509.

Examples

mgus <- data.frame(
  time = c(30, 45, 60, 72, 80, 95, 110, 120, 130, 150, 160, 180, 200, 210, 220, 240),
  status = c(1, 2, 0, 2, 1, 2, 0, 1, 2, 2, 0, 1, 1, 2, 0, 2),
  age = c(62, 75, 58, 80, 66, 71, 59, 64, 77, 82, 60, 68, 55, 79, 63, 74)
)
mgus$event <- factor(mgus$status, levels = 0:2, labels = c("censor", "pcm", "death"))

fit <- fine_gray(Surv(time, event) ~ age, data = mgus, cause = "pcm")
fit
#> <fine_gray> Surv(time, event) ~ age
#> Subdistribution hazards for cause "pcm". n = 16, events = 5
#> 
#>     estimate hazard_ratio robust_se statistic  p_value
#> age  -0.1045       0.9007   0.02739    -3.817 0.000135
#> 
#> Robust Wald test: 14.6 on 1 df, p = 0.000135
as.data.frame(fit, exponentiate = TRUE)
#>   term estimate  std_error statistic      p_value  conf_low conf_high
#> 1  age  0.90073 0.02738911 -3.817199 0.0001349753 0.8536522 0.9504041

# Cumulative incidence of pcm for two new subjects
predict(fit, newdata = data.frame(age = c(60, 75)), type = "cif", times = c(100, 200))
#>   subject time   estimate
#> 1       1  100 0.21347422
#> 2       1  200 0.61599266
#> 3       2  100 0.04881392
#> 4       2  200 0.18083387