plot.etm {etm} | R Documentation |
Plot method for an object of class 'etm'. It draws the estimated transition probabilities in a basic scatterplot.
## S3 method for class 'etm': plot(x, tr.choice = "all", xlab = "Time", ylab = "Transition Probability", col, lty, xlim, ylim, legend = TRUE, legend.pos, curvlab, legend.bty = "n", ...)
x |
An object of class 'etm' |
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 |
xlab |
x-axis label. Default is "Time" |
ylab |
y-axis label. Default is "Transition Probability" |
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 |
legend |
A logical specifying if a legend should be added |
legend.pos |
A vector giving the legend's position. See
legend for further details |
curvlab |
A character or expression vector to appear in the legend. Default is the name of the transitions |
legend.bty |
Box type for the legend |
... |
Further arguments for plot |
No value returned
Arthur Allignol, arthur.allignol@fdm.uni-freiburg.de
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"))