Skip to contents

Intensity lambda_i(t | H) = Y_i(t) lambda_0(t) exp(beta' X_i) with at-risk indicator Y_i(t) = 1 on (start_i, stop_i]. Newton-Raphson on the Breslow partial likelihood over counting-process risk sets. With one interval per subject starting at zero this reduces exactly to the ordinary Cox model.

Usage

Agrec(start, stop, event, X, max_iter = 50L, tol = 1e-09)

Arguments

start, stop

Left-open interval endpoints, stop > start.

event

1 if an event ends the interval, 0 if censored.

X

Covariate matrix, one row per interval.

max_iter, tol

Newton-Raphson controls.

Value

List with estimate, se, cov, loglik, n_iter, n_events, method.

References

Andersen, P. K. and Gill, R. D. (1982), Annals of Statistics 10(4), 1100-1120.

Examples

set.seed(1)
occ <- rep(1:3, times = 20)
start <- (occ - 1) * 10
stop <- occ * 10 - runif(60, 0, 3)
event <- rbinom(60, 1, 0.6)
X <- matrix(rnorm(60 * 2), 60, 2)
fit <- Agrec(start, stop, event, X)
length(fit$estimate) == 2L
#> [1] TRUE