Skip to contents

\(\log T = X\beta + \sigma W\), with \(W\) standard extreme value (Weibull; exponential fixes \(\sigma = 1\)), normal (lognormal) or logistic (loglogistic), fitted by maximum likelihood with right censoring: events contribute \(\log f(w) - \log\sigma - \log t\), censored units \(\log S(w)\), \(w = (\log t - X\beta)/\sigma\). The optimum is found with analytic gradients (BFGS) and polished by Newton steps on the analytic Hessian; the covariance is the inverse observed information in \((\beta, \log\sigma)\), as survival::survreg reports it.

Usage

morie_aft(
  time,
  event,
  X = NULL,
  dist = c("weibull", "lognormal", "loglogistic", "exponential")
)

Arguments

time

Positive follow-up times.

event

Event indicator (1 = event, 0 = censored).

X

Covariate matrix (an intercept is added), or NULL for an intercept-only model.

dist

One of "weibull", "lognormal", "loglogistic", "exponential".

Value

list with coefficients (intercept first), scale, loglik, vcov (of \(\beta\) and \(\log\sigma\)), dist, n, n_events.

References

Kalbfleisch JD, Prentice RL (2002). The Statistical Analysis of Failure Time Data, 2nd ed., ch. 2-3. Reference implementation: survival::survreg.

Examples

tt <- c(2, 3, 3, 5, 8, 9, 4, 6, 7, 10)
ee <- c(1, 1, 0, 1, 0, 1, 1, 0, 1, 1)
morie_aft(tt, ee, dist = "weibull")$scale
#> [1] 0.4302396