Plot method for cmp.rel. Plots the cumulative probability of death due to disease and due to population reasons
# S3 method for cmp.rel
plot(x, main, curvlab, ylim=c(0, 1), xlim, wh=2, xlab="Time (days)",
ylab="Probability", lty=1:length(x), xscale=1,col=1, lwd=par('lwd'),
curves, conf.int, all.times=FALSE,...)
a list, with each component representing one curve in the plot, output of the function cmp.rel
.
the main title for the plot.
Curve labels for the plot. Default is names(x)
, or if that is missing, 1:nc
, where nc
is the number of curves in x
.
yaxis limits for plot.
xaxis limits for plot (default is 0 to the largest time in any of the curves).
if a vector of length 2, then the upper right coordinates of the legend; otherwise the legend is placed in the upper right corner of the plot.
X axis label.
y axis label.
vector of line types. Default 1:nc
(nc
is the number of curves in x
). For color displays, lty=1
, color=1:nc
, might be more appropriate. If length(lty)<nc
, then lty[1]
is used for all.
Scale of the X axis. Default is in days (1).
vector of colors. If length(col)<nc
, then the col[1]
is used for all.
vector of line widths. If length(lwd)<nc
, then lwd[1]
is used for all.
Vector if integers, specifies which curves should be plotted. May take values 1:nc
, where nc
is the number of curves in x
. By default, all of the curves are plotted.
Vector if integers, specifies which confidence intervals should be plotted. May take values 1:nc
, where nc
is the number of curves in x
. By default, no confidence intervals are plotted.
By default, the disease specific mortality estimate is plotted as a step function between event or censoring times. If set to TRUE
, the graph is evaluated at all estimated times.
additional arguments passed to the initial call of the plot function.
No value is returned.
By default, the graph is plotted as a step function for the cause specific mortality and as a piecewise linear function for the population mortality. It is evaluated at all event and censoring times even though it constantly changes also between these time points.
If the argument all.times
is set to TRUE
, the plot is evaluated at all times that were used for numerical integration in the cmp.rel
function (there, the default is set to daily intervals). If only specific time points are to be added, this should be done via argument add.times
in cmp.rel
.
rs.surv
# NOT RUN {
data(slopop)
data(rdata)
fit <- cmp.rel(Surv(time,cens)~sex,rmap=list(age=age*365.241),
ratetable=slopop,data=rdata,tau=3652.41)
plot(fit,col=c(1,1,2,2),xscale=365.241,conf.int=c(1,3))
# }
Run the code above in your browser using DataLab