Skip to main content

Cox Regression: Does Money Keep Released Prisoners Out of Jail?

Cox proportional hazards regression in R with survival::coxph(), on a randomized experiment with 432 men released from prison: Kaplan-Meier curves and the log-rank test, the hazard, the partial likelihood by hand, hazard ratios, predicted survival and differences in weeks, testing proportional hazards and what to do when they fail, predictors that change over time, reverse causation and immortal time bias, residuals, ties and APA reporting.

The question: money for the first weeks of freedom

People who leave prison have little money and find it hard to get work. Many are soon arrested again. In the 1970s the state of Maryland made an experiment: of 432 men released from prison, half were chosen at random to receive a small weekly payment for three months. All were followed for one year. Did the money keep them out of jail (Rossi et al., 1980)?

The outcome is a time: the number of weeks until the first arrest. For most men it is not known, because they were not arrested in the year. We know only that their time is longer than 52 weeks. Such a time is censored. Neither a regression of the weeks (what value should the others have?) nor a logistic regression of arrested or not (an arrest in week 1 counts like one in week 52) uses what we know.

Survival analysis does, and Cox regression (Cox, 1972) is its most used model. It asks: at any moment, among those who are still free, how many times higher is the rate of arrest for one person than for another?

Code
library(survival)   # Surv(), survfit(), coxph(), cox.zph() (comes with R)
library(ggplot2)

arm_colours <- c(`no payment` = "#eb6834", payment = "#2a78d6")

# number formats for the text
f1   <- function(x) formatC(x, format = "f", digits = 1, big.mark = ",")
f2   <- function(x) formatC(x, format = "f", digits = 2, big.mark = ",")
f3   <- function(x) formatC(x, format = "f", digits = 3, big.mark = ",")
# no leading zero
nz <- function(x, d = 2) sub("^(-?)0", "\\1", formatC(x, format = "f", digits = d))
pval <- function(p) if (p < .001) "< .001" else paste("=", nz(p, 3))
pct  <- function(x, d = 0) paste0(formatC(100 * x, format = "f", digits = d), "%")

1. The data

Code
raw <- read.csv("https://vincentarelbundock.github.io/Rdatasets/csv/carData/Rossi.csv")
rossi <- with(
  raw,
  data.frame(
    id = seq_len(nrow(raw)),
    week,
    arrest,
    money = as.integer(fin == "yes"),
    age = (age - 25) / 5,
    prior = prio
  )
)
# employed in week 1, ..., 52 (NA after the arrest)
work <- as.matrix(raw[, paste0("emp", 1:52)]) == "yes"
nrow(rossi)
[1] 432
Code
table(money = rossi$money, arrest = rossi$arrest)
     arrest
money   0   1
    0 150  66
    1 168  48
Code
summary(rossi$week)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   1.00   50.00   52.00   45.85   52.00   52.00 

Each row is a man. week is the week of the first arrest, or 52; arrest is 1 if he was arrested and 0 if the time is censored at 52. money is the randomized payment, age his age at release in steps of 5 years from 25, and prior the number of earlier convictions. The file also says in which weeks he had a job, which we use in section 6. (The study has more variables. We keep the model small.)


2. Look at the data

Code
km <- survfit(Surv(week, arrest) ~ money, data = rossi)
km_data <- data.frame(
  time = km$time,
  surv = km$surv,
  low = km$lower,
  high = km$upper,
  arm = rep(names(arm_colours), km$strata)
)
km_data <- rbind(
  data.frame(time = 0, surv = 1, low = 1, high = 1, arm = names(arm_colours)),
  km_data
)
ggplot(km_data, aes(time, surv, colour = arm, fill = arm)) +
  geom_step(linewidth = 1) +
  scale_colour_manual(values = arm_colours, name = NULL) +
  scale_fill_manual(values = arm_colours, name = NULL) +
  scale_y_continuous(labels = function(v) paste0(100 * v, "%"), limits = c(0.6, 1)) +
  labs(
    title = "Men who have not been arrested (Kaplan–Meier)",
    x = "weeks since release",
    y = NULL
  ) +
  theme_bw() +
  theme(legend.position = "bottom")

Plot: 2. Look at the data

Code
free <- summary(km, times = 52)$surv
logrank <- survdiff(Surv(week, arrest) ~ money, data = rossi)
logrank
Call:
survdiff(formula = Surv(week, arrest) ~ money, data = rossi)

          N Observed Expected (O-E)^2/E (O-E)^2/V
money=0 216       66     55.6      1.96      3.84
money=1 216       48     58.4      1.86      3.84

 Chisq= 3.8  on 1 degrees of freedom, p= 0.05 

The Kaplan–Meier curve shows the share of men who are still free. After a year it is 69% without the payment and 78% with it. The log-rank test compares the two curves at all times: \(\chi^2\)(1) = 3.84, p = .050. The test has no predictors besides the groups and gives no size of an effect. That is what the regression is for.


3. The model step by step, with formulas

Step 1: the hazard

The hazard \(h(t)\) is the rate of the event at time \(t\) among those who have not had it yet. If 100 men are still free at the start of a week and 2 are arrested in it, the hazard is about 0.02 per week. It may go up and down over time.

Step 2: proportional hazards

\[h(t \mid x) = h_0(t)\, e^{\beta_1 x_1 + \beta_2 x_2 + \dots}\]

\(h_0(t)\) is the baseline hazard, of somebody with all predictors 0. It can have any shape, and we do not model it. The predictors multiply it by a factor that does not depend on time. So for two people who differ by one unit in \(x_1\), the ratio of their hazards is

\[\frac{h(t \mid x_1 + 1)}{h(t \mid x_1)} = e^{\beta_1} \quad\text{at every } t\]

the hazard ratio (HR). That it is the same at all times is the assumption of proportional hazards.

Step 3: the partial likelihood

Cox’s idea: at each arrest, ask only who among those still free is the one arrested. Given that one of them is, the probability that it is man \(i\) is his share of the total hazard, and \(h_0(t)\) cancels:

\[\frac{h_0(t)\, e^{x_i^\top\beta}}{\sum_{j \text{ still free}} h_0(t)\, e^{x_j^\top\beta}} = \frac{e^{x_i^\top\beta}}{\sum_{j \text{ still free}} e^{x_j^\top\beta}}\]

Multiply these over all the arrests, and find the \(\beta\) that makes the product largest. Only the order of the events matters, not the exact times. Censored men count in the sums as long as they are free.

Code
X <- as.matrix(rossi[, c("money", "age", "prior")])
minus_partial <- function(b) {
  # with Breslow's treatment of ties
  eta <- drop(X %*% b)
  -sum(sapply(which(rossi$arrest == 1), function(i) {
    eta[i] - log(sum(exp(eta[rossi$week >= rossi$week[i]])))
  }))
}
hand <- optim(c(0, 0, 0), minus_partial, method = "BFGS", control = list(reltol = 1e-12))
fit_breslow <- coxph(Surv(week, arrest) ~ money + age + prior, data = rossi, ties = "breslow")
rbind(by_hand = hand$par, coxph = coef(fit_breslow))
            money        age      prior
by_hand -0.346444 -0.3346050 0.09652746
coxph   -0.346444 -0.3346038 0.09652828

Step 4: ties

Time was recorded in weeks, so several men were arrested at the “same” time, and it is not clear who was in the sum when. The default of coxph() is Efron’s approximation, better than Breslow’s simple one above. With few ties they agree.


4. Fitting the model and reading the output

Code
fit <- coxph(Surv(week, arrest) ~ money + age + prior, data = rossi)
summary(fit)
Call:
coxph(formula = Surv(week, arrest) ~ money + age + prior, data = rossi)

  n= 432, number of events= 114 

          coef exp(coef) se(coef)      z Pr(>|z|)    
money -0.34695   0.70684  0.19025 -1.824 0.068197 .  
age   -0.33553   0.71496  0.10425 -3.218 0.001289 ** 
prior  0.09689   1.10174  0.02725  3.555 0.000378 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

      exp(coef) exp(-coef) lower .95 upper .95
money    0.7068     1.4148    0.4868     1.026
age      0.7150     1.3987    0.5828     0.877
prior    1.1017     0.9077    1.0444     1.162

Concordance= 0.63  (se = 0.027 )
Likelihood ratio test= 29.05  on 3 df,   p=2e-06
Wald test            = 27.94  on 3 df,   p=4e-06
Score (logrank) test = 29.03  on 3 df,   p=2e-06
Code
s  <- summary(fit)$coefficients; hr <- s[, 2]; ci <- exp(confint(fit))
con <- summary(fit)$concordance[[1]]
  • money: HR = 0.71. At any time, among men of the same age and record who are still free, the rate of arrest of those with the payment is 0.71 times that of the others, 29% lower. 95% CI [0.49, 1.03], p = .068: the interval reaches just over 1.
  • age: five years older, 0.71 times the hazard. prior: each earlier conviction, 1.10 times, so three more convictions, \(1.10^3\) = 1.34.
  • Concordance = 0.63: of two men of whom it is known who was arrested first, the model gives the higher risk to the right one in 63% of the pairs. 50% is guessing.
  • The three tests at the end (likelihood ratio, Wald, score) test all the predictors together. The score test with one group variable is the log-rank test.
  • There is no intercept: it is in the baseline hazard.

What a hazard ratio is not

An HR of 0.71 does not mean that 29% fewer men are arrested, nor that they stay free 1.41 times as long. It is a ratio of rates among those still free. For people, translate it into survival curves:

Code
new <- data.frame(money = c(0, 1), age = 0, prior = 2) # 25 years old, two earlier convictions
sf   <- survfit(fit, newdata = new)
at52 <- summary(sf, times = 52)$surv[1, ]
at52
        1         2 
0.7464424 0.8132593 
Code
curves <- data.frame(
  time = rep(sf$time, 2),
  surv = as.vector(sf$surv),
  low = as.vector(sf$lower),
  high = as.vector(sf$upper),
  arm = rep(names(arm_colours), each = length(sf$time))
)
ggplot(curves, aes(time, surv, colour = arm, fill = arm)) +
  geom_ribbon(aes(ymin = low, ymax = high), alpha = 0.15, colour = NA) +
  geom_step(linewidth = 1) +
  scale_colour_manual(values = arm_colours, name = NULL) +
  scale_fill_manual(values = arm_colours, name = NULL) +
  scale_y_continuous(labels = function(v) paste0(100 * v, "%"), limits = c(0.4, 1)) +
  labs(
    title = "Predicted: a man of 25 with two earlier convictions",
    x = "weeks since release",
    y = "not arrested"
  ) +
  theme_bw() +
  theme(legend.position = "bottom")

Predicted – What a hazard ratio is not

For such a man the model predicts a chance of 75% of staying free for a year without the payment, and 81% with it: 6.7 points more.

In weeks: the restricted mean

Another number for the whole experiment needs no model: the mean number of weeks free in the first 52, which is the area under the Kaplan–Meier curve.

Code
tab  <- summary(km, rmean = 52)$table
rm   <- tab[, "rmean"]; rm_se <- tab[, "se(rmean)"]
diff <- rm[[2]] - rm[[1]]; diff_se <- sqrt(sum(rm_se^2))
c(
  no_payment = rm[[1]],
  payment = rm[[2]],
  difference = diff,
  low = diff - 1.96 * diff_se,
  high = diff + 1.96 * diff_se
)
no_payment    payment difference        low       high 
44.8333333 46.8750000  2.0416667 -0.3359074  4.4192407 

On average the men with the payment were free for 2.0 weeks more of the 52, 95% CI [-0.3, 4.4].


5. Are the hazards proportional?

cox.zph() looks at the Schoenfeld residuals: at each arrest, how the arrested man differs from the average of those still free. If the effect of a predictor changes over time, they show a trend (Grambsch & Therneau, 1994).

Code
zph <- cox.zph(fit)
zph
        chisq df     p
money  0.0638  1 0.801
age    6.3255  1 0.012
prior  0.5187  1 0.471
GLOBAL 7.1367  3 0.068
Code
zd <- data.frame(
  time = rep(zph$time, 3),
  beta = as.vector(zph$y),
  term = rep(colnames(zph$y), each = length(zph$time))
)
ggplot(zd, aes(time, beta)) +
  geom_point(alpha = 0.5, colour = "grey40", size = 1.2) +
  geom_smooth(
    method = "loess",
    formula = y ~ x,
    colour = "#2a78d6",
    fill = "#2a78d6",
    alpha = 0.2
  ) +
  geom_hline(
    data = data.frame(term = names(coef(fit)), b = coef(fit)),
    aes(yintercept = b),
    colour = "#eb6834",
    linetype = "dashed"
  ) +
  facet_wrap(~term, scales = "free_y") +
  labs(
    title = "Does the coefficient change over time?",
    subtitle = "Blue: smoothed residuals. Dashed: the constant coefficient of the model",
    x = "weeks (transformed scale)",
    y = "coefficient"
  ) +
  theme_bw()

Zph chart – 5. Are the hazards proportional?

For the payment there is no sign of a change (p = .801). For age there is (p = .012): the line falls. Age hardly matters in the first weeks, and a lot later. What can be done?

  1. Let the effect change with time, for example linearly. tt() does it:
Code
fit_tt <- coxph(
  Surv(week, arrest) ~ money + age + prior + tt(age),
  data = rossi,
  tt = function(x, t, ...) x * (t - 26) / 26
)
round(coef(summary(fit_tt)), 3)
          coef exp(coef) se(coef)      z Pr(>|z|)
money   -0.349     0.706    0.190 -1.832    0.067
age     -0.337     0.714    0.106 -3.182    0.001
prior    0.098     1.103    0.027  3.602    0.000
tt(age) -0.498     0.607    0.191 -2.612    0.009
Code
age_at <- function(w) exp(coef(fit_tt)[["age"]] + coef(fit_tt)[["tt(age)"]] * (w - 26) / 26)
c(week_5 = age_at(5), week_26 = age_at(26), week_52 = age_at(52))
   week_5   week_26   week_52 
1.0677175 0.7138407 0.4336248 

Five years more multiply the hazard by 1.07 in week 5 and by 0.43 at the end of the year.

  1. Stratify: give each age group its own baseline hazard. Age then has no coefficient, and the others are adjusted for it without any assumption:
Code
rossi$age_group <- cut(raw$age, c(0, 19, 22, 25, 100), labels = c("-19", "20-22", "23-25", "26-"))
fit_strata <- coxph(Surv(week, arrest) ~ money + prior + strata(age_group), data = rossi)
round(
  rbind(
    original = coef(summary(fit))["money", ],
    stratified = coef(summary(fit_strata))["money", ],
    time_varying_age = coef(summary(fit_tt))["money", ]
  ),
  3
)
                   coef exp(coef) se(coef)      z Pr(>|z|)
original         -0.347     0.707     0.19 -1.824    0.068
stratified       -0.363     0.696     0.19 -1.909    0.056
time_varying_age -0.349     0.706     0.19 -1.832    0.067
  1. Or leave it, and read the HR as an average over time, if the predictor is only there for adjustment. The effect of the payment, our question, is the same in all three: 0.70 and 0.71 against 0.71.

6. Predictors that change over time: having a job

Did the men who found work stay free? Work changes from week to week, so it cannot be one number per man. Two wrong ways and a better one.

The trap: “ever employed”

Code
rossi$ever <- as.integer(apply(work, 1, any, na.rm = TRUE))
wrong <- coxph(Surv(week, arrest) ~ money + age + prior + ever, data = rossi)
round(coef(summary(wrong))["ever", ], 4)
     coef exp(coef)  se(coef)         z  Pr(>|z|) 
  -1.1302    0.3230    0.2028   -5.5722    0.0000 

Men who were ever employed have a hazard 0.32 times that of the others. It looks like a miracle, and it is a mistake. To find a job in week 20 a man must first stay free for 20 weeks. During those weeks he could not be arrested and count as employed: he was “immortal”. The variable looks into the future. This is immortal time bias (Suissa, 2008), and it is still found in medical journals.

The right data: one row per man and week

Split each man’s time into weeks. In each, the job status is what it was then:

Code
long <- do.call(
  rbind,
  lapply(seq_len(nrow(rossi)), function(i) {
    w <- rossi$week[i]
    data.frame(
      rossi[i, c("id", "money", "age", "prior")],
      start = 0:(w - 1),
      stop = 1:w,
      arrest = c(rep(0, w - 1), rossi$arrest[i]),
      job = as.integer(work[i, 1:w]),
      row.names = NULL
    )
  })
)
long$job_before <- ave(long$job, long$id, FUN = function(v) c(NA, head(v, -1))) # the week before
subset(long, id == 1)[14:20, ]
   id money age prior start stop arrest job job_before
14  1     0 0.4     3    13   14      0   0          0
15  1     0 0.4     3    14   15      0   0          0
16  1     0 0.4     3    15   16      0   0          0
17  1     0 0.4     3    16   17      0   0          0
18  1     0 0.4     3    17   18      0   0          0
19  1     0 0.4     3    18   19      0   0          0
20  1     0 0.4     3    19   20      1   0          0
Code
nrow(long)
[1] 19809
Code
same_week <- coxph(Surv(start, stop, arrest) ~ money + age + prior + job, data = long)
week_before <- coxph(Surv(start, stop, arrest) ~ money + age + prior + job_before, data = long)
round(
  rbind(
    same_week = coef(summary(same_week))["job", ],
    week_before = coef(summary(week_before))["job_before", ]
  ),
  4
)
               coef exp(coef) se(coef)       z Pr(>|z|)
same_week   -1.3482    0.2597   0.2493 -5.4081    0e+00
week_before -0.8112    0.4443   0.2165 -3.7474    2e-04

The outcome is now Surv(start, stop, arrest). Each row is at risk only in its own week, and a man leaves the risk set when he is arrested. (The rows of one man are not repeated observations that need a correction: at each event he appears once.)

  • With the job in the same week, the HR is 0.26. But there is a second trap. An arrest on Monday costs the job of that week. The cause may run backwards.
  • With the job in the week before, the HR is 0.44, 95% CI [0.29, 0.68]. That is the number to believe, more or less. Men were not assigned to jobs at random, as they were to the payment, and those who find work may be those who would stay free anyway.

And note: the job may be on the way from the payment to freedom (or away from it, since the payment was cut when a man earned money). Adjusting for it changes the meaning of the effect of the payment.


7. More checks

Code
m0 <- coxph(Surv(week, arrest) ~ money, data = rossi)
md <- rbind(
  data.frame(x = raw$age, r = residuals(m0, type = "martingale"), what = "age (years)"),
  data.frame(x = rossi$prior, r = residuals(m0, type = "martingale"), what = "earlier convictions")
)
ggplot(md, aes(x, r)) +
  geom_point(alpha = 0.3, size = 1) +
  geom_smooth(method = "loess", formula = y ~ x, colour = "#2a78d6", se = FALSE) +
  facet_wrap(~what, scales = "free_x") +
  labs(
    title = "Martingale residuals: what shape should the predictor have?",
    x = NULL,
    y = "residual of a model without it"
  ) +
  theme_bw()

Martingale – 7. More checks

Code
infl <- residuals(fit, type = "dfbetas"); colnames(infl) <- names(coef(fit))
worst <- apply(abs(infl), 2, max)
worst
    money       age     prior 
0.1168141 0.4480371 0.2842831 
Code
fit_log <- coxph(Surv(week, arrest) ~ money + log(raw$age) + prior, data = rossi)
c(AIC_linear_age = AIC(fit), AIC_log_age = AIC(fit_log))
AIC_linear_age    AIC_log_age 
      1327.714       1326.204 
  • Shape of the predictors. The smooth line of the martingale residuals (observed minus expected arrests) against age falls steeply at first and then flattens: the logarithm of age would fit a little better (AIC 1,326.2 against 1,327.7).
  • Influence. No man moves a coefficient by more than 0.45 standard errors.

8. Things to keep in mind

  • Independent censoring. The method assumes that those who leave the study would have gone on like those who stay. Here almost all the censoring is the end of the year, which is harmless.
  • Events decide the power, not people. With 114 arrests a model has room for about 11 predictors at most.
  • The hazard ratio and selection. Even in a randomized experiment, those still free after 30 weeks are not a random half any more: if the money works, the high-risk men of the payment group are still in it. So the HR at later times is not a clean comparison (Hernán, 2010). Differences of survival curves and restricted means are.
  • Adding predictors changes the HR of the others even if they are unrelated to them (as for odds ratios). Compare models with care.
  • Several events. We used the first arrest. For repeated events there are extensions (Andersen–Gill).
  • Other ways to end. If some men had died, death would be a competing risk.
  • Parametric models (Weibull and others) estimate the baseline too, and can predict beyond the data.
  • Discrete time. With few intervals, a complementary log-log regression on person-weeks gives the same hazard ratios.

9. Reporting the results in APA style

A report (APA 7th edition) needs the start and end of the time, the number of events, the method for ties, hazard ratios with intervals, the check of proportional hazards, and survival at some times. The numbers come from the R objects:

Code
apa_table <- data.frame(
  Predictor = c("Payment", "Age (5 years)", "Earlier convictions (each)"),
  b = f2(s[, 1]),
  SE = f2(s[, 3]),
  z = f2(s[, 4]),
  p = sapply(s[, 5], function(p) sub("^= ", "", pval(p))),
  HR = paste0(f2(hr), " [", f2(ci[, 1]), ", ", f2(ci[, 2]), "]")
)

Method (data analysis):

We analyzed the time from release to the first arrest in 432 men who were randomly assigned to a weekly payment for three months or to no payment (Rossi et al., 1980). Men not arrested within 52 weeks were censored. Arrest-free survival was described with Kaplan–Meier curves and compared with the log-rank test. Hazard ratios were estimated with Cox regression (Efron’s method for ties), adjusting for age and the number of earlier convictions. Proportional hazards were tested with scaled Schoenfeld residuals; because the effect of age changed over time, we repeated the analysis stratified by age group. Employment was analyzed as a time-dependent covariate, lagged by one week. Analyses were conducted in R (Version 4.6.2; R Core Team, 2026) with the package survival (Therneau & Grambsch, 2000).

Results:

Within a year, 48 of 216 men with the payment and 66 of 216 without it were arrested; the proportion free after 52 weeks was 78% and 69%, log-rank χ²(1) = 3.84, p = .050. In the Cox model, the hazard of arrest was lower with the payment, HR = 0.71, 95% CI [0.49, 1.03], p = .068, a difference that did not reach significance (Table 1). The men with the payment were free for 2.0 more of the 52 weeks, 95% CI [-0.3, 4.4]. Proportional hazards held for the payment (p = .801) but not for age (p = .012); in the analysis stratified by age, HR = 0.70. Having had a job in the week before went with a lower hazard, HR = 0.44, 95% CI [0.29, 0.68].

Table 1

Cox Regression of the Time to the First Arrest

Predictor b SE z p HR [95% CI]
Payment -0.35 0.19 -1.82 .068 0.71 [0.49, 1.03]
Age (5 years) -0.34 0.10 -3.22 .001 0.71 [0.58, 0.88]
Earlier convictions (each) 0.10 0.03 3.56 < .001 1.10 [1.04, 1.16]

Note. N = 432, 114 arrests. HR = hazard ratio. Concordance = .63.

Points to remember:

  • Define time zero, the event and the censoring.
  • Give the number of events.
  • Report the test of proportional hazards, and what you did about it.
  • Add survival proportions or restricted means: hazard ratios are hard to picture.
  • Never use a variable that looks into the future.

10. Summary

When Time to an event, with censored cases, and the interest is in relative rates
The model \(h(t \mid x) = h_0(t)\,e^{x^\top\beta}\), with any baseline
Estimation Partial likelihood: at each event, who among those at risk?
How (R) coxph(Surv(time, event) ~ x, data); changing predictors: Surv(start, stop, event)
Reading it \(e^\beta\): hazard ratio, the same at all times
Check cox.zph(); if it fails: tt(), strata(), or read it as an average
Also report Kaplan–Meier, survival at chosen times, restricted means
Traps Immortal time, reverse causation, informative censoring
Related pages Censored quantile regression, complementary log-log

References

Cox, D. R. (1972). Regression models and life-tables. Journal of the Royal Statistical Society: Series B, 34(2), 187–202. https://doi.org/10.1111/j.2517-6161.1972.tb00899.x

Grambsch, P. M., & Therneau, T. M. (1994). Proportional hazards tests and diagnostics based on weighted residuals. Biometrika, 81(3), 515–526. https://doi.org/10.1093/biomet/81.3.515

Hernán, M. A. (2010). The hazards of hazard ratios. Epidemiology, 21(1), 13–15. https://doi.org/10.1097/EDE.0b013e3181c1ea43

Rossi, P. H., Berk, R. A., & Lenihan, K. J. (1980). Money, work, and crime: Experimental evidence. Academic Press.

Suissa, S. (2008). Immortal time bias in pharmacoepidemiology. American Journal of Epidemiology, 167(4), 492–499. https://doi.org/10.1093/aje/kwm324

Therneau, T. M., & Grambsch, P. M. (2000). Modeling survival data: Extending the Cox model. Springer.