plot.hazdata {eha} | R Documentation |
Baseline hazards estimates.
plot.hazdata(x, fn = c("cum", "surv", "log", "loglog"), fig = TRUE, xlim=NULL, ylim=NULL, main=NULL, xlab=NULL, ylab=NULL, ...)
x |
A hazdata object, typically the 'hazards' element in
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) |
main |
A heading for the plot. |
xlab |
Label on the x axis. |
ylab |
Label on the y-axis. |
... |
Anything that plot.default likes... |
It is also possible to have as first argument an object of type "coxreg", given that it contains a component of type "hazdata".
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(s).
Göran Broström
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(fit$hazards)