predict.tune.ahazpen: Prediction methods for tune.ahazpen

predict.tune.ahazpenR Documentation

Prediction methods for tune.ahazpen

Description

Compute regression coefficient estimates, linear predictor, cumulative hazard function, or integrated martingale residuals for a fitted and tuned penalized semiparametric additive hazards model.

Usage

## S3 method for class 'tune.ahazpen'
predict(object, newX,  lambda="lambda.min", ...)
## S3 method for class 'tune.ahazpen'
coef(object, ...)

Arguments

object

The result of an ahazpen fit.

newX

New matrix of covariates at which to do predictions. Required for some types of predictions, see predict.ahazpen.

lambda

Value of lambda at which predictions are to be made. Required for some types of predictions, see predict.ahazpen. Default is the optimal lambda value saved in object.

...

Additional arguments to be passed to predict.ahazpen (usually the type of prediction required).

Details

See the details in predict.ahazpen for information on the available types of predictions.

Value

The obejct returned depends on the details in the argument ... passed to predict.ahazpen.

See Also

predict.ahazpen, ahazpen, print.ahazpen, plot.ahazpen, predict.ahaz, plot.cumahaz.

Examples

data(sorlie)

set.seed(10101)

# Break ties
time <- sorlie$time+runif(nrow(sorlie))*1e-2

# Survival data + covariates
surv <- Surv(time,sorlie$status)
X <- as.matrix(sorlie[,3:ncol(sorlie)])

# Fit additive hazards regression model w/lasso penalty
cv.fit <- tune.ahazpen(surv, X, dfmax=100, tune="cv")

# Predict coefficients at cv.fit$lambda.min
coef(cv.fit)

# Predict risk score at cv.fit$lambda.min
predict(cv.fit,newX=X,type="lp")


ahaz documentation built on May 13, 2022, 9:08 a.m.