\(\hat P(s,t) = \prod_{s<u\le t}(I + d\hat A(u))\), a
nonparametric product integral over event times. Rows sum to one by
construction. Mirrors morie.fn.mstrn.
Usage
morie_aalen_johansen(
time,
state_from,
state_to,
n_states = NULL,
s = 0,
t = NULL
)
Arguments
- time
numeric transition times.
- state_from, state_to
integer states, 0-indexed.
- n_states
total number of states; inferred if NULL.
- s, t
interval endpoints; t defaults to the last event time.
Value
list: P, event_times, increments, at_risk, n_states,
n_transitions.
References
Aalen, O. O. & Johansen, S. (1978). An empirical
transition matrix for non-homogeneous Markov chains based on
censored observations. Scand. J. Statist., 5(3), 141-150.
Examples
morie_aalen_johansen(1:6, c(0, 0, 0, 1, 0, 1), c(1, 1, 2, 2, 1, 2), 3)$P
#> [,1] [,2] [,3]
#> [1,] 0 0.46875 0.53125
#> [2,] 0 0.56250 0.43750
#> [3,] 0 0.00000 1.00000