evalstep {icmstate} | R Documentation |
Sample from a markov chain multi state model with exactly observed transition times
Description
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).
Usage
evalstep(time, stepf, newtime, subst = -Inf, to.data.frame = FALSE)
Arguments
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 |
Value
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.
Author(s)
Hein Putter
Examples
obs_states <- evalstep(time = seq(0, 20, 2), stepf = sample(1:9, 11, replace = TRUE),
newtime = c(-1, 1, 7, 9, 19))
obs_states
[Package icmstate version 0.1.1 Index]