The log-hazard is continuous and piecewise linear in time,
log h(t) = a + b t + sum_k d_k (t - tau_k)_+ (the joinpoint model of
Kim, Fay, Feuer and Midthune 2000 applied to the hazard), fitted by
exact maximum likelihood with closed-form cumulative hazards.
Joinpoints are searched over a grid of event-time percentiles and
their number is chosen by BIC, -2 log L + (2 + 2k) log n.
Usage
morie_jnpnt(time, event, max_joinpoints = 3L)
Arguments
- time
Observed event or censoring times.
- event
Event indicator (1 event, 0 censored).
- max_joinpoints
Maximum number of joinpoints tried.
Value
List with n_joinpoints, joinpoints, slopes
and intercepts per segment, bic, log_likelihood,
n_obs, n_events.
Examples
set.seed(1)
tt <- rexp(60, 0.3)
r <- morie_jnpnt(tt, rep(1, 60), max_joinpoints = 1)
r$n_joinpoints
#> [1] 0