plot.etm {etm}R Documentation

Plot method for an etm object

Description

plot method for an object of class 'etm'. This function plots estimates of the transition probabilities in one panel.

Usage

## S3 method for class 'etm':
plot(x, tr.choice, xlab = "Time",
ylab = "Transition Probability",
legend = TRUE, curvlab, locator = FALSE,
coord, col, lty, xlim, ylim, ...)

Arguments

x An object of class 'etm'
tr.choice A character vector of the form 'c("from to","from to")' specifying which transitions should be plotted. Default, all the transition probabilities are plotted
xlab x-axis label. Default is "Time"
ylab y-axis label. Default is "Transition Probability"
legend A logical specifying if a legend should be added
curvlab If legeng=TRUE, a character or expression vector to appear in the legend. Default is the name of the transitions
locator A logical indicating whether use locator to put the legend
coord If locator=FALSE, a vector of length 2 indicating the coordinates of the legend
col Vector of colour. Default is black
lty Vector of line type. Default is 1:number of transitions
xlim Limits of x-axis for the plot
ylim Limits of y-axis for the plot
... Additional arguments for plot

Details

This plot method permits to draw several transition probabilities on the same panel.

Value

No value returned.

Author(s)

Arthur Allignol arthur.allignol@fdm.uni-freiburg.de

See Also

etm, xyplot.etm

Examples

data(sir.cont)

# Modification for patients entering and leaving a state
# at the same date
sir.cont <- sir.cont[order(sir.cont$id, sir.cont$time), ]
for (i in 2:nrow(sir.cont)) {
  if (sir.cont$id[i]==sir.cont$id[i-1]) {
    if (sir.cont$time[i]==sir.cont$time[i-1]) {
      sir.cont$time[i-1] <- sir.cont$time[i-1] - 0.5
    }
  }
}

tra <- matrix(ncol=3,nrow=3,FALSE)
tra[1, 2:3] <- TRUE
tra[2, c(1, 3)] <- TRUE

my.etm <- etm(sir.cont,c("0","1","2"),tra,"cens", s = 0)

plot(my.etm, tr.choice = c("0 0"))

[Package etm version 0.3-3 Index]