Last chance! 50% off unlimited learning
Sale ends in
pmatrix.msm
to
models with time-dependent covariates. Note that
pmatrix.msm
is sufficient to calculate transition
probabilities for time-inhomogeneous
models fitted using the pci
argument to msm
.pmatrix.piecewise.msm(x, t1, t2, times, covariates,
ci=c("none","normal","bootstrap"), cl=0.95, B=1000, ...)
msm
. This should be a non-homogeneous model, whose
transition intensity matrix depends on a time-dependent covariate.times
. Each component of the list is specified in the same
way as the covariates
argument to pmatrix.msm
"normal"
, then calculate a confidence interval for
the transition probabilities by simulating B
random vectors
from the asymptotic multivariate normal distribution implied by the
maximum likelihood estimates (and cMatrixExp
to
control the method of computing the matrix exponential.[t1, tn]
. That is, the probabilities of
occupying state $s$ at time $t_n$
conditionally on occupying state $r$ at time $t_1$.
Rows correspond to "from-state" and columns to "to-state".pmatrix.msm
## In a clinical study, suppose patients are given a placebo in the
## first 5 weeks, then they begin treatment 1 at 5 weeks, and
## a combination of treatments 1 and 2 from 10 weeks.
## Suppose a multi-state model x has been fitted for the patients'
## progress, with treat1 and treat2 as time dependent covariates.
## Cut points for when treatment covariate changes
times <- c(0, 5, 10)
## Indicators for which treatments are active in the four intervals
## defined by the three cut points
covariates <- list( list (treat1=0, treat2=0), list (treat1=0, treat2=0), list(treat1=1, treat2=0),
list(treat1=1, treat2=1) )
## Calculate transition probabilities from the start of the study to 15 weeks
pmatrix.piecewise.msm(x, 0, 15, times, covariates)
Run the code above in your browser using DataLab