Skip to contents

A separate, unspecified baseline hazard per stratum with one shared coefficient vector: the strata contribute their own partial likelihoods, which are summed.

Usage

morie_cox_stratified(
  time,
  event,
  X,
  stratum,
  ties = "efron",
  max_iter = 50L,
  tol = 1e-09
)

Arguments

time

follow-up times, non-negative.

event

1 for an event, 0 for right-censored.

X

covariate matrix, one row per subject.

stratum

stratum label per subject.

ties

"efron" or "breslow".

max_iter, tol

Newton-Raphson controls.

Value

list with beta, se, z, p_value, hazard_ratio, loglik, strata, events_per_stratum, empty_strata.

Details

The stratifier gets no coefficient and no hazard ratio – that is the price of not assuming proportional hazards for it. Stratify on the nuisance variable, never on the exposure you are trying to estimate. Strata with no events contribute nothing at all and are reported.

References

Kalbfleisch, J. D. and Prentice, R. L. (2002). The Statistical Analysis of Failure Time Data, 2nd ed., Sec. 4.4.

Examples

set.seed(1)
X <- matrix(rnorm(80), ncol = 1)
s <- rep(1:2, each = 40)
tt <- rexp(80, exp(X * 0.5) * s)
morie_cox_stratified(tt, rep(1, 80), X, s)$beta
#> [1] 0.6277523