| predict.tune.ahazpen {ahaz} | R 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 |
newX |
New matrix of covariates at which to do
predictions. Required for some types of predictions, see |
lambda |
Value of lambda at which predictions are
to be made. Required for some types of predictions, see
|
... |
Additional arguments to be passed to
|
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")