evalstep | R Documentation |
Given a markov chain multi state model with exactly observed transition times, sample from this chain at the observation times, giving interval censored observations (panel data).
evalstep(time, stepf, newtime, subst = -Inf, to.data.frame = FALSE)
time |
Times at which a transition occurs |
stepf |
States at which the chain is in at |
newtime |
Observation times of the chain, to create observed states |
subst |
State to return if observation time is before first transition time. Default = -Inf. |
to.data.frame |
Should the result be returned as a |
A numeric vector
or data.frame
(if to.data.frame = TRUE
)
containing either the observed states or the named columns newtime
and
res
, representing the observation times and observed states.
Hein Putter
obs_states <- evalstep(time = seq(0, 20, 2), stepf = sample(1:9, 11, replace = TRUE),
newtime = c(-1, 1, 7, 9, 19))
obs_states
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.