plot.mvna {mvna} | R Documentation |
plot method for an object of class 'mvna'. This function plots estimates of the cumulative transition hazards in one panel.
## S3 method for class 'mvna': plot(x, tr.choice, xlab = "Time", ylab = "Nelson-Aalen estimates", col, lty, xlim, ylim, legend = TRUE, legend.pos, curvlab, legend.bty = "n", ...)
x |
An object of class 'mvna' |
tr.choice |
A character vector of the form 'c("from to","from to")' specifying which transitions should be plotted. Default, all the cumulative transition hazards are plotted |
xlab |
x-axis label. Default is "Time" |
ylab |
y-axis label. Default is "Nelson-Aalen estimates" |
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 |
This plot method permits to draw several cumulative transition hazards on the same panel.
x
with the invisible flag set
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 na.cont <- mvna(sir.cont,c("0","1","2"),tra,"cens") plot(na.cont, tr.choice=c("0 2", "1 2"))