Learn R Programming

p3state.msm (version 1.3)

plot.p3state: Plot Method for an p3state object

Description

Plot method for an object of class 'p3state'. It draws the estimated transition probabilities, bivariate distribution of the gap times and marginal distribution of the second gap time (the last two only available for the progressive three-state model)

Usage

"plot"(x, plot.trans = NULL, plot.marginal = NULL, plot.bivariate = NULL, time1, time2, xlab, ylab, zlab, col, col.biv = NULL, ...)

Arguments

x
an object of class p3state.
plot.trans
Graphical output for the transition probabilities. By default, plot.trans=FALSE. Possible values are: "all", "P11", "P12", "P22" and "P23".
plot.marginal
Graphical output for the marginal distribution of the second time (only available for the progressive three-state model). By default, plot.marginal=FALSE.
plot.bivariate
Graphical output for the bivariate distribution (only available for the progressive three-state model). By default, plot.bivariate=FALSE.
time1
The first time for obtaining estimates for the transition probabilities, bivariate distribution function. NULL is equivalent to 0.
time2
The second time for obtaining estimates for the bivariate distribution function.
xlab
x-axix label.
ylab
y-axix label.
zlab
z-axix label (only for the bivariate distribution).
col
Colour for the bivariate plot.
col.biv
A logical variable indicating whether you want color to be used in the filled.contour plot. By default col.biv = FALSE.
...
Further arguments for plot

See Also

p3state

Examples

Run this code
data(heart2)
res.p3state<-p3state(heart2)
##Only transition probabilities
plot(res.p3state,plot.trans="all",time1=20,time2=100)

##Example of three-state model. All plots.
p<-which((heart2$delta==0 & heart2$status==0) | heart2$delta==1)
inputdata<-heart2[p,]
res2.p3state<-p3state(inputdata)
plot(res2.p3state,plot.trans="all",time1=20,
time2=200,plot.bivariate=TRUE,plot.marginal=TRUE)

Run the code above in your browser using DataLab