pcoxsurvfit.pcoxtime: Compute survival curve and cumulative hazard from a pcoxtime...

View source: R/posthocfuns.R

pcoxsurvfit.pcoxtimeR Documentation

Compute survival curve and cumulative hazard from a pcoxtime model

Description

Compute the predicted survivor and cumulative hazard function for a penalized Cox proportional hazard model.

Usage

## S3 method for class 'pcoxtime'
pcoxsurvfit(fit, newdata, ...)

## S3 method for class 'pcoxtime'
pcoxbasehaz(fit, centered = TRUE)

Arguments

fit

fitted pcoxtime object

newdata

a data frame containing the variables appearing on the right hand side of pcoxtime formula.

...

for future implementations

centered

if TRUE (default), return data from a predicted survival function at the mean values of the predictors, if FALSE returns prediction for all predictors equal to zero (baseline hazard).

Details

pcoxsurvfit and pcoxbasehaz functions produce survival curves and estimated cumulative hazard, respectively, for the fitted pcoxtime model. They both return the estimated survival probability and the estimated cumulative hazard, which are both Breslow estimate.

The pcoxbasehaz is an alias for pcoxsurvfit 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.

Value

pcoxsurvfit and pcoxbasehaz return S3 objects of class pcoxsurvfit.pcoxtime and pcoxbasehaz.pcoxtime, 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 t.

n.event

the number of events that occur at time t.

n.censor

the number of subjects who exit the risk set, without an event, at time t.

surv

a vector or a matrix of estimated survival function.

cumhaz, hazard

a vector or a matrix of estimated cumulative hazard.

call

the call that produced the object.

See Also

pcoxtime, plot.pcoxsurvfit

Examples


data(heart, package="survival")
lam <- 0.1
alp <- 0.8
pfit <- pcoxtime(Surv(start, stop, event) ~ age + year + surgery + transplant
	, data = heart
	, lambda = lam
	, alpha = alp
)

# Survival estimate
psurv <- pcoxsurvfit(pfit)
print(psurv)

# Baseline survival estimate
bsurv <- pcoxbasehaz(pfit, centered = FALSE)


pcoxtime documentation built on May 13, 2022, 1:05 a.m.