Kaplan-Meier plots of (repeated) time-to-event data. Includes VPCs.
kaplan.plot(
x = "TIME",
y = "DV",
id = "ID",
data = NULL,
evid = "EVID",
by = NULL,
xlab = "Time",
ylab = "Default",
object = NULL,
events.to.plot = "All",
sim.data = NULL,
sim.zip.file = NULL,
VPC = FALSE,
nsim.lab = "simNumber",
sim.evct.lab = "counter",
probs = c(0.025, 0.975),
add.baseline = T,
add.last.area = T,
subset = NULL,
main = "Default",
main.sub = "Default",
main.sub.cex = 0.8,
nbins = NULL,
real.type = "l",
real.lty = 1,
real.lwd = 1,
real.col = "blue",
real.se = if (!is.null(sim.data)) F else T,
real.se.type = "l",
real.se.lty = 2,
real.se.lwd = 0.5,
real.se.col = "red",
cens.type = "l",
cens.lty = 1,
cens.col = "black",
cens.lwd = 1,
cens.rll = 0.02,
inclZeroWRES = TRUE,
onlyfirst = FALSE,
samp = NULL,
poly.alpha = 1,
poly.fill = "lightgreen",
poly.line.col = "darkgreen",
poly.lty = 2,
censor.lines = TRUE,
ylim = c(-5, 105),
cov = NULL,
cov.fun = "mean",
...
)The independent variable.
The dependent variable. event (>0) or no event (0).
The ID variable in the dataset.
A dataset can be used instead of the data in an Xpose object.
Must have the same form as an xpose data object xpdb@Data.
The EVID data item. If not present then all rows are considered events (can be censored or an event). Otherwise, EVID!=0 are dropped from the data set.
A vector of conditioning variables.
X-axis label
Y-axis label
An Xpose object. Needed if no data is supplied.
Vector of events to be plotted. "All" means that all events are plotted.
The simulated data file. Should be a table file with one
header row and have, at least, columns with headers corresponding to
x, y, id, by (if used), nsim.lab and
sim.evct.lab.
The sim.data can be in \.zip format and xpose
will unzip the file before reading in the data. Must have the same
structure as described above in sim.data.
TRUE or FALSE. If TRUE then Xpose will
search for a zipped file with name
paste("simtab",object@Runno,".zip",sep=""), for example
"simtab42.zip".
The column header for sim.data that contains the
simulation number for that row in the data.
The column header for sim.data that contains the
individual event counter information. For each individual the event counter
should increase by one for each event (or censored event) that occurs.
The probabilities (non-parametric percentiles) to use in computation of the prediction intervals for the simulated data.
Should a (x=0,y=1) baseline measurement be added to each individual in the dataset. Otherwise each plot will begin at the first event in the dataset.
Should an area be added to the VPC extending the last PI?
The subset of the data and sim.data to use.
The title of the plot. Can also be NULL or
"Default".
The title of the subplots. Must be a list, the same length
as the number of subplots (actual graphs), or NULL or
"Default".
The size of the title of the subplots.
The number of bins to use in the VPC. If NULL, the the
number of unique x values in sim.data is used.
Type for the real data.
Line type (lty) for the curve of the original (or real) data.
Line width (lwd) for the real data.
Color for the curve of the original (or real) data.
Should the standard errors of the real (non simulated) data
be plotted? Calculated using survfit.
Type for the standard errors.
Line type (lty) for the standard error lines.
Line width (lwd) for the standard error lines.
Color for the standard error lines.
Type for the censored lines.
Line type (lty) for the censored lines.
Color for the censored lines.
Line width for the censored lines.
The relative line length of the censored line compared to the limits of the y-axis.
Include WRES=0 rows from the real data set in the plots?
Include only the first measurement for the real data in the plots?
Simulated data in the xpose data object can be used as the
"real" data. samp is a number selecting which simulated data set to
use.
The transparency of the VPC shaded region.
The fill color of the VPC shaded region.
The line colors for the VPC region.
The line type for the VPC region.
Should censored observations be marked on the plot?
Limits for the y-axes
The covariate in the dataset to plot instead of the survival curve.
The summary function for the covariate in the dataset to plot instead of the survival curve.
Additional arguments passed to the function.
returns an object of class "xpose.multiple.plot".
survfit, Surv,
xpose.multiple.plot.
Other specific functions:
absval.cwres.vs.cov.bw(),
absval.cwres.vs.pred(),
absval.cwres.vs.pred.by.cov(),
absval.iwres.cwres.vs.ipred.pred(),
absval.iwres.vs.cov.bw(),
absval.iwres.vs.idv(),
absval.iwres.vs.ipred(),
absval.iwres.vs.ipred.by.cov(),
absval.iwres.vs.pred(),
absval.wres.vs.cov.bw(),
absval.wres.vs.idv(),
absval.wres.vs.pred(),
absval.wres.vs.pred.by.cov(),
absval_delta_vs_cov_model_comp,
addit.gof(),
autocorr.cwres(),
autocorr.iwres(),
autocorr.wres(),
basic.gof(),
basic.model.comp(),
cat.dv.vs.idv.sb(),
cat.pc(),
cov.splom(),
cwres.dist.hist(),
cwres.dist.qq(),
cwres.vs.cov(),
cwres.vs.idv(),
cwres.vs.idv.bw(),
cwres.vs.pred(),
cwres.vs.pred.bw(),
cwres.wres.vs.idv(),
cwres.wres.vs.pred(),
dOFV.vs.cov(),
dOFV.vs.id(),
dOFV1.vs.dOFV2(),
data.checkout(),
dv.preds.vs.idv(),
dv.vs.idv(),
dv.vs.ipred(),
dv.vs.ipred.by.cov(),
dv.vs.ipred.by.idv(),
dv.vs.pred(),
dv.vs.pred.by.cov(),
dv.vs.pred.by.idv(),
dv.vs.pred.ipred(),
gof(),
ind.plots(),
ind.plots.cwres.hist(),
ind.plots.cwres.qq(),
ipred.vs.idv(),
iwres.dist.hist(),
iwres.dist.qq(),
iwres.vs.idv(),
par_cov_hist,
par_cov_qq,
parm.vs.cov(),
parm.vs.parm(),
pred.vs.idv(),
ranpar.vs.cov(),
runsum(),
wres.dist.hist(),
wres.dist.qq(),
wres.vs.idv(),
wres.vs.idv.bw(),
wres.vs.pred(),
wres.vs.pred.bw(),
xpose.VPC(),
xpose.VPC.both(),
xpose.VPC.categorical(),
xpose4-package
if (FALSE) { # \dontrun{
library(xpose4)
## Read in the data
runno <- "57"
xpdb <- xpose.data(runno)
####################################
# here are the real data plots
####################################
kaplan.plot(x="TIME",y="DV",object=xpdb)
kaplan.plot(x="TIME",y="DV",object=xpdb,
events.to.plot=c(1,2),
by=c("DOSE==0","DOSE!=0"))
kaplan.plot(x="TIME",y="DV",object=xpdb,
events.to.plot=c(1,2),
by=c("DOSE==0","DOSE==10",
"DOSE==50","DOSE==200"))
## make a PDF of the plots
pdf(file=paste("run",runno,"_kaplan.pdf",sep=""))
kaplan.plot(x="TIME",y="DV",object=xpdb,
by=c("DOSE==0","DOSE==10",
"DOSE==50","DOSE==200"))
dev.off()
####################################
## VPC plots
####################################
kaplan.plot(x="TIME",y="DV",object=xpdb,VPC=T,events.to.plot=c(1))
kaplan.plot(x="TIME",y="DV",object=xpdb,VPC=T,
events.to.plot=c(1,2,3),
by=c("DOSE==0","DOSE!=0"))
kaplan.plot(x="TIME",y="DV",object=xpdb,VPC=T,
events.to.plot=c(1),
by=c("DOSE==0","DOSE==10","DOSE==50","DOSE==200"))
## make a PDF of all plots
pdf(file=paste("run",runno,"_kaplan.pdf",sep=""))
kaplan.plot(x="TIME",y="DV",object=xpdb,VPC=T,
by=c("DOSE==0","DOSE==10","DOSE==50","DOSE==200"))
dev.off()
} # }