Learn R Programming

eha (version 1.2-18)

plot.coxreg: Plots of survivor functions.

Description

Baseline hazards estimates.

Usage

plot.coxreg(x, fn = c("cum", "surv", "log", "loglog"), fig = TRUE,
xlim=NULL, ylim=NULL, main=NULL, xlab="Duration", ylab="",
new.data = x$means, ...)

Arguments

x
A coxreg object, typically the output from link{coxreg}.
fn
Which type of plot?
fig
Should a plot actually be produced? Default is TRUE.
xlim
Horizontal plot limits. If NULL, calculated by the function.
ylim
Vertical plot limits. If NULL, set to c(0, 1) for a survival plot, otherwise adaptive, data dependent.
main
A heading for the plot.
xlab
Label on the x axis.
ylab
Label on the y-axis.
new.data
At what covariate values should the calculations be done? Default is the mean values of the covariates.
...
Anything that plot.default likes...

Value

  • A list where the elements are two-column matrices, one for each stratum in the model. The first column contains risktimes, and the second the y coordinates for the requested curve.

Details

This function is a wrapper for plot.hazdata.

Examples

Run this code
time0 <- numeric(50)
group <- c(rep(0, 25), rep(1, 25))
time1 <- rexp( 50, exp(group) )
event <- rep(1, 50) 
fit <- coxreg(Surv(time0, time1, event) ~ strata(group))
plot.coxreg(fit)

Run the code above in your browser using DataLab