Learn R Programming

TP.idm (version 1.0)

plot.TPidm: Plot method for a TPidm object

Description

Plot method for an object of class ‘TPidm’. It draws the estimated occupation probabilities (if s = 0) or transition probabilities (if s > 0) and confidence intervals (only available if CI is TRUE) in a basic scatterplot or in a multipanel layout.

Usage

"plot"(x, chosen.tr = "ALL", ...)

Arguments

x
An object of class ‘TPidm’.
chosen.tr
Character vector of the form ‘c(“from to”, “from to”)’ specifying which transitions should be plotted. Default, all the transition probabilities are plotted.
...
Further arguments to plot.

Examples

Run this code
data(colonTP)

# create a TPidm object with s = 0, t = "last" (default),
# CI = FALSE (default) and method = "NM" (default):
tp_s0_nm <- TPidm(colonTP, s = 0)

# plot all possible transitions without CI:
plot(tp_s0_nm)

# or 
# create a TPidm object with s = 0, t = "last" (default),
# CI = TRUE and method = "AJ":
tp_s0_aj_ci <- TPidm(colonTP, s = 0, CI = TRUE, method = "AJ")

# plot transitions "1 2" and "1 3" with CI:
plot(tp_s0_aj_ci, chosen.tr = c("1 2", "1 3"))

Run the code above in your browser using DataLab