ahaz (version 1.14)

predict.tune.ahazpen: 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 tune.ahazpen
predict(object, newX,  lambda="lambda.min", …)
# S3 method for 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).

Value

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

Details

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

See Also

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

Examples

Run this code
# NOT RUN {
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")

# }

Run the code above in your browser using DataLab