| predict_cox_pls | R Documentation |
These methods extend stats::predict() for Cox models fitted with the
original PLS engines exposed by coxgpls(), coxsgpls(), and their
deviance-residual or kernel variants. They provide access to latent component
scores alongside linear predictors and risk estimates, ensuring consistent
behaviour with the newer big-memory solvers.
## S3 method for class 'coxgpls'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
## S3 method for class 'coxgplsDR'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
## S3 method for class 'coxsgpls'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
## S3 method for class 'coxsgplsDR'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
## S3 method for class 'coxspls_sgpls'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
## S3 method for class 'coxDKgplsDR'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
## S3 method for class 'coxDKsgplsDR'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
## S3 method for class 'coxDKspls_sgplsDR'
predict(
object,
newdata = NULL,
type = c("link", "risk", "response", "components"),
comps = NULL,
coef = NULL,
...
)
object |
A fitted model returned by |
newdata |
Optional matrix or data frame of predictors. When |
type |
Type of prediction requested: |
comps |
Optional integer vector specifying which latent components to retain. Defaults to all available components. |
coef |
Optional coefficient vector overriding the Cox model
coefficients stored in |
... |
Unused arguments for future extensions. |
When type is "components", a matrix of latent scores; otherwise a
numeric vector containing the requested prediction with names inherited from
the supplied data.
Bastien, P., Bertrand, F., Meyer, N., & Maumy-Bertrand, M. (2015). Deviance residuals-based sparse PLS and sparse kernel PLS for censored data. Bioinformatics, 31(3), 397–404. doi:10.1093/bioinformatics/btu660
Bertrand, F., Bastien, P., & Maumy-Bertrand, M. (2018). Cross validating extensions of kernel, sparse or regular partial least squares regression models to censored data. https://arxiv.org/abs/1810.01005.
coxgpls(), coxsgpls(), coxspls_sgpls(),
coxDKgplsDR(), predict.big_pls_cox(), computeDR().
if (requireNamespace("survival", quietly = TRUE)) {
data(micro.censure, package = "bigPLScox")
data(Xmicro.censure_compl_imp, package = "bigPLScox")
X <- as.matrix(Xmicro.censure_compl_imp[1:60, 1:10])
time <- micro.censure$survyear[1:60]
status <- micro.censure$DC[1:60]
set.seed(321)
fit <- coxgpls(
Xplan = X,
time = time,
status = status,
ncomp = 2,
allres = TRUE
)
predict(fit, newdata = X[1:5, ], type = "risk")
head(predict(fit, type = "components"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.