markov_sde  R Documentation 
A numerically efficient algorithm to calculate predictions from a continuous time, nonhomogeneous Markov multistate model. The main inputs are are a list of Aalen's additive hazards models, the initial values, the transition matrix and the covariate patterns. The predictions include state occupancy probabilities and length of stay. Standard errors are calculated using the delta method. Includes differences and standardisation.
markov_sde(models, trans, newdata, init = NULL, nLebesgue = 10000 + 1, los = FALSE,
nOut = 300, weights = 1)
## S3 method for class 'markov_sde'
standardise(x, ...)
## S3 method for class 'markov_sde'
plot(x, y, stacked=TRUE, which=c("P","L"), index=NULL,
xlab="Time", ylab=NULL, col=2:6, border=col,
ggplot2=FALSE, lattice=FALSE, alpha=0.2,
strata=NULL,
...)
## S3 method for class 'markov_sde'
as.data.frame(x, row.names=NULL, optional=NULL, ci=TRUE,
P.conf.type="logit", L.conf.type="log",
P.range=c(0,1), L.range=c(0,Inf),
...)
models 
list of models. Currently allows only for 
trans 
Transition matrix describing the states and transitions
in the multistate model. If S is the number of states in the
multistate model, 
newdata 

init 
vector of the initial values with the same length as the number of states. Defaults to the first state having an
initial value of 1 (i.e. 
nLebesgue 
Number of steps for the continuous integration 
los 
logical variable for whether to estimate the length of stay 
nOut 
number of rows to represent the continuous changes 
weights 
numeric vector to represent differences or standardisation 
For plot.markov_sde
:
y 
(currently ignored) 
stacked 
logical for whether to stack the plots. Default: TRUE 
index 
indicator of which row of 
which 
character to indicate either transition probabilities ( 
xlab 
xaxis label 
ylab 
xaxis label 
col 
colours (ignored if 
border 
border colours for the 
ggplot2 
use 
alpha 
alpha value for confidence bands (ggplot) 
lattice 
use 
strata 
formula for the stratification factors for the plot 
For as.data.frame.markov_sde
:
row.names 
add in row names to the output dataframe 
optional 
(not currently used) 
ci 
logical for whether to include confidence intervals. Default: TRUE 
P.conf.type 
type of transformation for the confidence interval
calculation for the state occupancy probabilities. Default: logit transformation. This is changed to 
L.conf.type 
type of transformation for the confidence interval
calculation for the length of stay calculation. Default: log transformation. 
P.range 
valid values for the state occupancy probabilities. Default: (0,1). 
L.range 
valid values for the state occupancy probabilities. Default: (0,Inf). 
For standardise.markov_sde
:
x 
object to extract standardised values 
... 
other arguments. For 
Uses an approach developed by Ryalen and colleagues. This is a reimplementation in C++.
The current implementation only allows for a vector of initial values rather than a matrix. The predictions will need to be rerun for different vectors of initial values.
markov_sde
returns an object of class
"markov_sde"
.
Mark Clements
markov_msm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.