predict.tune.ahazpen | R Documentation |
Compute regression coefficient estimates, linear predictor, cumulative hazard function, or integrated martingale residuals for a fitted and tuned penalized semiparametric additive hazards model.
## S3 method for class 'tune.ahazpen' predict(object, newX, lambda="lambda.min", ...) ## S3 method for class 'tune.ahazpen' coef(object, ...)
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
|
See the details in predict.ahazpen
for information on
the available types of predictions.
The obejct returned depends on the details in the argument ...
passed
to predict.ahazpen
.
predict.ahazpen
, ahazpen
, print.ahazpen
,
plot.ahazpen
, predict.ahaz
, plot.cumahaz
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.