plot-grpsurv-func: Plot survival curve for grpsurv model

Description Usage Arguments Author(s) See Also Examples

Description

Plot survival curve for a model that has been fit using grpsurv followed by a prediction of the survival function using predict.grpsurv

Usage

1
2
## S3 method for class 'grpsurv.func'
plot(x, alpha=1, ...)

Arguments

x

A 'grpsurv.func' object, which is returned by predict.grpsurv if type='survival' is specified. See examples.

alpha

Controls alpha-blending (i.e., transparency). Useful if many overlapping lines are present.

...

Other graphical parameters to pass to plot

Author(s)

Patrick Breheny

See Also

grpsurv, predict.grpsurv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

Example output



grpreg documentation built on July 27, 2021, 1:08 a.m.