Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot-ncvsurv-func

Plot survival curve for ncvsurv model


Description

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

Usage

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

Arguments

x

A 'ncvsurv.func' object, which is returned by predict.ncvsurv 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

Examples

data(Lung)
X <- Lung$X
y <- Lung$y

fit <- ncvsurv(X, y)

# A single survival curve
S <- predict(fit, X[1,], type='survival', lambda=.15)
plot(S, xlim=c(0,200))

# Lots of survival curves
S <- predict(fit, X, type='survival', lambda=.08)
plot(S, xlim=c(0,200), alpha=0.3)

ncvreg

Regularization Paths for SCAD and MCP Penalized Regression Models

v3.13.0
GPL-3
Authors
Patrick Breheny [aut, cre] (<https://orcid.org/0000-0002-0650-1119>)
Initial release
2021-03-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.