predict.coxpath {glmpath} | R Documentation |
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 λ.
predict.coxpath(object, data, s, type = c("coefficients", "loglik", "lp", "risk", "coxph"), mode = c("step", "norm.fraction", "norm", "lambda.fraction", "lambda"), eps = .Machine$double.eps, ...)
object |
a coxpath object
|
data |
a list containing x, time, and status, with which
the predictions are made. If type=lp or type=risk, then
x is required. If type=loglik or type=coxph, then
x, time, and status are required.
|
s |
the values of mode at which the predictions are made. If
type=coxph, only the first element of s is used.
|
type |
If type=coefficients, the coefficients are returned; if
type=loglik, log-partial-likelihoods are returned; if
type=lp, linear predictors (x'β) are returned; if
type=risk, risks (e^{x'β}) are returned; and if
type=coxph, a coxph object (as in survival
package) at the first element of s is returned. (i.e. the
components of a coxph object such as coefficients, variance,
and the test statistics are adjusted to the shrinkage corresponding to
s. A coxph object can be further used as an argument to
the functions in survival package.) Default is
coefficients. The coefficients for the initial input variables
are returned (rather than the standardized coefficients).
|
mode |
what mode=s refers to. If mode=step, s is the
number of steps taken; if mode=norm.fraction, s is the
fraction of the L1 norm of the standardized coefficients (with respect
to the largest norm); if mode=norm, s is the L1 norm of the
standardized coefficients; if mode=lambda.fraction, s is
the fraction of log(λ); and if mode=lambda,
s is λ. Default is step.
|
eps |
an effective zero |
... |
other options for the prediction |
Mee Young Park and Trevor Hastie
Mee Young Park and Trevor Hastie (2006) L1 Regularization Path Algorithm for Generalized Linear Models - available at the authors' websites, http://www.stanford.edu/~mypark or http://stat.stanford.edu/~hastie/pub.htm.
cv.coxpath, coxpath, plot.coxpath
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)