Learn R Programming

TPmsm (version 1.1.0)

contour.TPCmsm: contour method for a TPCmsm object

Description

contour method for an object of class 'TPCmsm'. Creates a contour plot of the transition probabilities.

Usage

## S3 method for class 'TPCmsm':
contour(x, contour.type="tc", tr.choice, nlevels=20, levels=pretty(zlim, nlevels),
xlim, ylim, zlim=c(0, 1), col=grey(0.4), xlab, ylab, main="", sub="",
add=FALSE, las=1, conf.int=FALSE, legend=TRUE, curvlab, ...)

Arguments

x
An object of class 'TPCmsm'.
contour.type
A character string specifying the type of contour. If 'tc' the contour with time in the x axis, covariate in the y axis and transition probability in the z axis is drawn. If 'ct' the contour with covariate in the x axis, time in the y axis and transit
tr.choice
Character vector of the form 'c("from to", "from to")' specifying which transitions should be plotted. Default, all the transition probabilities are plotted.
nlevels
The number of levels to divide the range of z. Defaults to 20 levels.
levels
Numeric vector of levels at which to draw contour lines. Defaults to pretty(zlim, nlevels).
xlim
Limits of x-axis for the plot.
ylim
Limits of y-axis for the plot.
zlim
Limits of z-axis for the plot. Defaults to c(0, 1).
col
Color for the lines drawn. Defaults to grey(0.4).
xlab
x-axis label. If contour.type="tc" defaults to "Time". If contour.type="ct" defaults to "Covariate".
ylab
y-axis label. If contour.type="tc" defaults to "Covariate". If contour.type="ct" defaults to "Time".
main
The main title for the plot. By default no main title is added.
sub
A sub title for the plot. By default no sub title is added.
add
logical. If TRUE, add to a current plot.
las
The style of labeling to be used. The default is to use horizontal labeling.
conf.int
Logical. Whether to display contour plots of confidence regions. Default is FALSE.
legend
A logical specifying if a legend should be added.
curvlab
A character or expression vector to appear in the legend. Default is the name of the transitions.
...
Further arguments for contour.

Value

  • No value is returned.

encoding

UTF-8

References

Meira-Machado L., de Uña-Álvarez J. and Datta S. Conditional Transition Probabilities in a non-Markov Illness-death Model. Discussion Papers in Statistics and Operations Research n 11/03, 2011. Department of Statistics and Operations Research, University of Vigo (ISSN: 1888-5756, Deposito Legal VG 1402 - 2007). This file can be downloaded from: http://webs.uvigo.es/depc05/reports/12_05.pdf

See Also

contour.

Examples

Run this code
# set the number of threads
nth <- threadsTP(2)

# Create survTP object
data(colonTP)
colonTP_obj <- with( colonTP, survTP(time1, event1, Stime, event, age=age) )

# Compute IPCW conditional transition probabilities without confidence band
TPCmsm_obj <- transIPCW(colonTP_obj, s=57, t=310, x=0)

# Plot contour with Time in the x-axis
contour(TPCmsm_obj, contour.type="tc", tr.choice=c("1 1", "1 2", "2 2"), ylab="Age")

# Plot contour with Time in the y-axis
contour(TPCmsm_obj, contour.type="ct", tr.choice=c("1 1", "1 2", "1 3"), xlab="Age")

# restore the number of threads
threadsTP(nth)

Run the code above in your browser using DataLab