Skip to contents

morie_cox_frailty under its statistical name. The gamma is conjugate to the Poisson likelihood the Cox model implies, which is why the frailty update is closed-form rather than an inner optimisation.

Usage

morie_gamma_frailty_cox(time, event, X, cluster, ...)

Arguments

time

follow-up times, non-negative.

event

1 for an event, 0 for right-censored.

X

covariate matrix, one row per subject.

cluster

cluster label per subject.

...

passed to morie_cox_frailty.

Value

list as morie_cox_frailty plus marginal_attenuation.

Details

The consequence worth remembering is that the MARGINAL hazard ratio – what you get from a model that ignores the clustering – is attenuated toward 1 relative to the conditional one estimated here. The two are answers to different questions, not an estimate and a better estimate.

References

Clayton, D. G. (1978). A model for association in bivariate life tables. Biometrika, 65(1), 141-151.

Examples

# \donttest{
set.seed(4)
X <- matrix(rnorm(120), ncol = 1)
cl <- rep(1:20, each = 6)
tt <- rexp(120, exp(X * 0.5))
round(morie_gamma_frailty_cox(tt, rep(1, 120), X, cl)$theta, 3)
#> [1] 0.006
# }