predict.coxpath {glmpath} | R Documentation |
Makes predictions at particular points along the fitted coxpath
Description
This function makes predictions at particular points along the fitted
coxpath.
The coefficients, log-partial-likelihood, linear
predictor or the risk can be computed. A coxph
object can be
returned at one particular value of \lambda.
Usage
## S3 method for class 'coxpath'
predict(object, data, s, type = c("coefficients", "loglik",
"lp", "risk", "coxph"), mode = c("step",
"norm.fraction", "norm", "lambda.fraction", "lambda"),
eps = .Machine$double.eps, ...)
Arguments
object |
a |
data |
a list containing |
s |
the values of |
type |
If |
mode |
what |
eps |
an effective zero |
... |
other options for the prediction |
Author(s)
Mee Young Park and Trevor Hastie
References
Mee Young Park and Trevor Hastie (2007) L1 regularization path algorithm for generalized linear models. J. R. Statist. Soc. B, 69, 659-677.
See Also
cv.coxpath, coxpath, plot.coxpath
Examples
data(lung.data)
attach(lung.data)
fit <- coxpath(lung.data)
pred.a <- predict(fit, x, s = seq(0, 1, length=10),
mode = "norm.fraction")
library(survival)
pred.b <- predict(fit, lung.data, s = 0.5, type = "coxph",
mode = "lambda.fraction")
pred.s <- survfit(pred.b)
plot(pred.s)
detach(lung.data)