plot.nhm: Plot transition probabilities or intensities from a fitted...

View source: R/utils.R

plot.nhmR Documentation

Plot transition probabilities or intensities from a fitted nhm model.

Description

Produces plots of the transition probabilites or intensities from a non-homogeneous Markov or misclassification type hidden Markov multi-state model fitted using nhm.

Usage

## 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, main_arg=NULL, xlab="Time", ...)

Arguments

x

Fitted model object produced using nhm.

what

Character string to indicate what should be plotted. Options are probabilities (the default which produces transition probabilities) or intensities (to produce a plot of the intensities)

time0

Starting time from which to compute the transition probabilities or intensities. Defaults to 0.

state0

Starting state from which to compute the transition probabilities. Defaults to 1. Not required for transition intensities

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 time0 to the maximum observed time in the data.

covvalue

Optional vector of covariate vectors (should be given in the order specified in the covariate option in nhm). If omitted the function will use the mean values of the covariates.

ci

If TRUE pointwise confidence intervals will be shown in addition to the point estimates.

sim

If TRUE a simulation Delta method (Mandel, 2013) will be used to calculate the confidence intervals. Otherwise the standard Delta method will be applied.

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 lsoda when solving the differential equations for the transition probabilites.

atol

Absolute tolerance parameter to be used by lsoda when solving the differential equations for the transition probabilites.

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.

...

Other items to be passed to the function. Currently not used.

Details

Computation is performed by calling predict.nhm, for the transition probabilities, or qmatrix.nhm for the intensities (see for more details).

Value

Generates a multi-pane plot for each state. If values are required they can be obtained using predict.nhm.

Author(s)

Andrew Titman a.titman@lancaster.ac.uk

References

Mandel M. Simulation-based confidence intervals for functions with complicated derivatives. 2013. The American Statistician, 67. 76-81.

See Also

nhm, predict.nhm, qmatrix.nhm


nhm documentation built on Nov. 3, 2023, 1:12 a.m.

Related to plot.nhm in nhm...