densregion.survfit {denstrip}R Documentation

Density regions for survival curves

Description

Adds a density region to a survival plot. The shading of the region has darkness proportional to the fiducial density of the point. This distribution is assumed to be normal with standard deviation calculated using the lower confidence limit stored in the survival curve object.

Usage

## S3 method for class 'survfit':
densregion(x, ny=20, ...)

Arguments

x Survival curve object, returned by survfit. Confidence intervals must have been calculated, using conf.type.
ny Minimum number of points to calculate the density at for each event time. The default of 20 should be sufficient to obtain smooth-looking plots.
... Further arguments passed to densregion.default.

Details

The density is calculated at a grid of points, and interpolated using the method referred to in densregion.

Note

This approach can only illustrate one survival curve per plot. Ideas would be welcome for how to define the shading for multiple curves, when the shaded areas representing the confidence regions overlap.

Author(s)

Christopher Jackson <chris.jackson@mrc-bsu.cam.ac.uk>

References

Jackson, C. H. (2008) Displaying uncertainty with shading. The American Statistician, 62(4):340-347. http://www.mrc-bsu.cam.ac.uk/personal/chris/papers/denstrip.pdf

See Also

densregion, densregion.normal, denstrip

Examples

library(survival)
fit <- survfit(Surv(time, status) ~ 1, data=aml, conf.type="log-log")
plot(fit, col=0)
densregion(fit)
lines(fit, lwd=3, conf.int=FALSE, lty=1)
lines(fit, lwd=3, conf.int=TRUE, lty=2)

## Wider CIs based on log survival
fit <- survfit(Surv(time, status) ~ 1, data=aml, conf.type="log")
plot(fit, col=0) 
densregion(fit) # Big variation in maximum density 
densregion(fit, pointwise=TRUE, colmax="maroon4")
par(new=TRUE)
plot(fit)

## Narrower CIs based on untransformed survival.
## Normal assumption probably unrealistic
fit <- survfit(Surv(time, status) ~ 1, data=aml, conf.type="plain")
plot(fit, col=0) 
densregion(fit, pointwise=TRUE, colmax="darkmagenta")
par(new=TRUE)
plot(fit)


[Package denstrip version 1.3 Index]