plot.nhm | R Documentation |
Produces plots of the transition probabilites, intensities or state occupation probabilities
from a non-homogeneous Markov or misclassification type hidden Markov multi-state model fitted
using nhm
.
## S3 method for class 'nhm'
plot(x, what="probabilities",time0=0, state0=1, times=NULL,
covvalue=NULL, ci=TRUE, sim=FALSE, coverage=0.95, B=1000, rtol=1e-6,
atol=1e-6, initp=NULL, ltrunc=NULL, main_arg=NULL, xlab="Time",
statemerge=FALSE, ...)
x |
Fitted model object produced using |
what |
Character string to indicate what should be plotted. Options are |
time0 |
The starting time from which to compute the transition probabilities or intensities. |
state0 |
Starting state from which to compute the transition probabilities. Defaults to 1. Not required for transition intensities or state occupation probabilities. |
times |
Optional vector of times at which to compute the transition probabilities or intensities. If omitted, the probabilities/intensities will be computed at a sequence of times of length 100 from |
covvalue |
Optional vector of covariate vectors (should be given in the order specified in the |
ci |
If |
sim |
If |
coverage |
Coverage level (should be a value between 0 and 1) for the confidence intervals. Defaults to 0.95. |
B |
Number of simulations to be performed to compute the simulation Delta method. |
rtol |
Relative tolerance parameter to be used by |
atol |
Absolute tolerance parameter to be used by |
initp |
Optional vector of initial state occupation probabilities. If omitted then will use the estimates from the model fit. |
ltrunc |
Optional list containing "ltruncation_states": a vector specifying the indices of the non-absorbing states. "ltruncation_time": the time/age at which patients are left-truncation. Note: this list can be omitted if original model involved left-truncation. |
main_arg |
Character string specifying beginning of title to be given to each of the plot panes generated. |
xlab |
Character string specifying x-axis label to be given to each plot. |
statemerge |
Logical of whether the estimates should merge together latent states. Only relevant for models fitted using |
... |
Other items to be passed to the function. Currently not used. |
Computation is performed by calling predict.nhm
, for the transition probabilities, qmatrix.nhm
for the intensities or state_occupation_probability.nhm
for state occupation probabilities (see for more details).
Generates a multi-pane plot for each state. If values are required they can be obtained using predict.nhm
.
Andrew Titman a.titman@lancaster.ac.uk
Mandel M. Simulation-based confidence intervals for functions with complicated derivatives. 2013. The American Statistician, 67. 76-81.
nhm
, predict.nhm
, qmatrix.nhm
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.