View source: R/plot-grpsurv-func.R
plot.grpsurv.func | R Documentation |
Plot survival curve for a model that has been fit using grpsurv
followed by a prediction of the survival function using
predict.grpsurv
## S3 method for class 'grpsurv.func'
plot(x, alpha = 1, ...)
x |
A |
alpha |
Controls alpha-blending (i.e., transparency). Useful if many overlapping lines are present. |
... |
Other graphical parameters to pass to |
Patrick Breheny
grpsurv
, predict.grpsurv
data(Lung)
X <- Lung$X
y <- Lung$y
group <- Lung$group
fit <- grpsurv(X, y, group)
# A single survival curve
S <- predict(fit, X[1,], type='survival', lambda=.05)
plot(S, xlim=c(0,200))
# Lots of survival curves
S <- predict(fit, X, type='survival', lambda=.05)
plot(S, xlim=c(0,200), alpha=0.3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.