View source: R/glmnetsurvfit.R
glmnetsurvfit.glmnetsurv | R Documentation |
Compute the predicted survivor and cumulative hazard function for a penalized Cox proportional hazard model.
## S3 method for class 'glmnetsurv' glmnetsurvfit(fit, newdata, ...) ## S3 method for class 'glmnetsurv' glmnetbasehaz(fit, centered = TRUE)
fit |
fitted |
newdata |
a matrix containing the variables appearing on the right hand side of the model formula of |
... |
for future implementations |
centered |
if |
glmnetsurvfit
and glmnetbasehaz
functions produce survival curves and estimated cumulative hazard, respectively, for a glmnet
model fitted through glmnetsurv
. They both return the estimated survival probability and the estimated cumulative hazard, which are both Breslow estimate.
The glmnetbasehaz
is an alias for glmnetsurvfit
which simply computed the predicted survival estimates (baseline).
If the newdata
argument is missing, the "average" survival or cumulative hazard estimates are produced with the predictor values equal to means of the data set. See survfit.coxph
for warning against this. If the newdata
is specified, then the returned object will contain a matrix of both survival and cumulative hazard estimates with each column for each row in the newdata
.
glmnetsurvfit
and glmnetbasehaz
return S3 objects of class glmnetsurvfit.glmnetsurv
and glmnetbasehaz.glmnetsurv
, respectively:
n |
number of observations used in the fit. |
events |
total number of events of interest in the fit. |
time |
time points defined by the risk set. |
n.risk |
the number of individuals at risk at time |
n.event |
the number of events that occur at time |
n.censor |
the number of subjects who exit the risk set, without an event, at time |
surv |
a vector or a matrix of estimated survival function. |
cumhaz, hazard |
a vector or a matrix of estimated cumulative hazard. |
s |
lambda value. |
call |
the call that produced the object. |
glmnet
, plot.glmnetsurvfit
data(veteran, package="survival") lam <- 0 alp <- 1 gmodel <- glmnetsurv(Surv(time, status) ~ factor(trt) + karno + diagtime + age + prior , data = veteran , alpha = alp , lambda = lam ) # Survival estimate gsurv <- glmnetsurvfit(fit = gmodel) # Baseline survival estimate gbsurv <- glmnetbasehaz(gmodel, centered = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.