Skip to contents

Regression on log time, \(\log T = x'\beta + \sigma W\) with W standard extreme-value. The Weibull is the one family that is both AFT and proportional hazards, which is why it is the usual starting point.

Usage

morie_aft_weibull(time, event, X, ...)

Arguments

time

follow-up times, strictly positive.

event

1 for an event, 0 for right-censored.

X

covariate matrix, one row per subject. An intercept is added.

...

passed to the fitter (max_iter, tol, add_intercept).

Value

list with beta, se, time_ratio, sigma, loglik, aic, and the pieces morie_aft_residuals needs.

Details

The direction of the coefficient is the opposite of Cox's and is the standard trap: exp(beta) is a TIME RATIO, so a positive coefficient means LONGER survival. In a Cox model a positive coefficient means a higher hazard, i.e. shorter survival.

References

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

Examples

set.seed(2)
X <- matrix(rnorm(200), ncol = 2)
tt <- exp(0.5 + X %*% c(0.8, -0.4) - 0.7 * log(rexp(100)))
round(morie_aft_weibull(tt, rep(1, 100), X)$time_ratio, 3)
#> [1] 5.403 3.260 0.702