Learn R Programming

bigPLScox (version 0.8.1)

predict_cox_pls: Predict survival summaries from legacy Cox-PLS fits

Description

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.

Usage

# S3 method for coxgpls
predict(
  object,
  newdata = NULL,
  type = c("link", "risk", "response", "components"),
  comps = NULL,
  coef = NULL,
  ...
)

# S3 method for coxgplsDR predict( object, newdata = NULL, type = c("link", "risk", "response", "components"), comps = NULL, coef = NULL, ... )

# S3 method for coxsgpls predict( object, newdata = NULL, type = c("link", "risk", "response", "components"), comps = NULL, coef = NULL, ... )

# S3 method for coxsgplsDR predict( object, newdata = NULL, type = c("link", "risk", "response", "components"), comps = NULL, coef = NULL, ... )

# S3 method for coxspls_sgpls predict( object, newdata = NULL, type = c("link", "risk", "response", "components"), comps = NULL, coef = NULL, ... )

# S3 method for coxDKgplsDR predict( object, newdata = NULL, type = c("link", "risk", "response", "components"), comps = NULL, coef = NULL, ... )

# S3 method for coxDKsgplsDR predict( object, newdata = NULL, type = c("link", "risk", "response", "components"), comps = NULL, coef = NULL, ... )

# S3 method for coxDKspls_sgplsDR predict( object, newdata = NULL, type = c("link", "risk", "response", "components"), comps = NULL, coef = NULL, ... )

Value

When type is "components", a matrix of latent scores; otherwise a numeric vector containing the requested prediction with names inherited from the supplied data.

Arguments

object

A fitted model returned by coxgpls(), coxsgpls(), coxspls_sgpls(), or any of their deviance-residual/kernel counterparts with allres = TRUE.

newdata

Optional matrix or data frame of predictors. When NULL, the training components stored in object are reused.

type

Type of prediction requested: "link" for linear predictors, "risk"/"response" for exponentiated scores, or "components" to return latent PLS scores.

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 object.

...

Unused arguments for future extensions.

References

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.

See Also

coxgpls(), coxsgpls(), coxspls_sgpls(), coxDKgplsDR(), predict.big_pls_cox(), computeDR().

Examples

Run this code
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"))
}

Run the code above in your browser using DataLab