Learn R Programming

SmoothHazard (version 1.0.9)

plot.idm: Plot method for an illness-death model.

Description

Plot estimated baseline transition intensities from an object of class idmWeib or idmPl. Confidence bands are allowed.

Usage

## S3 method for class 'idm':
plot(x, conf.bands=FALSE, ylim,
 pos.legend = "topleft", main, transition, ...)

Arguments

x
a idmWeib class object or a idmPl class object (output from calling idm function).
conf.bands
logical value. Determines whether confidence bands will be plotted. The default is FALSE.
ylim
vector containing the y limites (min, max) of the plot. The default is the min and the max of all the values of the three transition intensities
pos.legend
The location of the legend can be specified by setting this argument to a single keyword from the list "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". The default is "topleft"
main
title of plot
transition
a vector of the transitions to plotted on separate graphs. Possible value are "01","02" and "12". The default is a plot of the 3 intensities on the same graph.
...
other graphical parameters.

Value

  • Print a plot of the baseline transition intensities of an illness-death model.

See Also

idm

Examples

Run this code
# Weibull illness deaths model 
data(Dem15_h_3)
d <- Dem15_h_3
names(d) <- c("dementia","mort","entry","L","R","time","cep")

fit.weib <- idm(formula02=Hist(time,event=mort,entry=entry)~cep,
formula01=Hist(time=list(L,R),event=dementia)~cep,data=d) 

# no confidence bands
plot(fit.weib)

# confidence bands for transition 0 --> 1
plot(fit.weib,conf.bands=TRUE,transition="01")

Run the code above in your browser using DataLab