Learn R Programming

plsRcox (version 1.8.2)

predict.coxDRmodel: Predict method for DR-based Cox component models

Description

This function provides prediction methods for the rich objects returned by coxplsDR(..., allres = TRUE), coxsplsDR(..., allres = TRUE) and coxDKsplsDR(..., allres = TRUE).

Usage

# S3 method for coxplsDRmodel
predict(
  object,
  newdata,
  comps = ncol(object$tt_plsDR),
  type = c("lp", "risk", "expected", "terms", "scores"),
  se.fit = FALSE,
  reference = c("strata", "sample", "zero"),
  y = NULL,
  weights = NULL,
  verbose = TRUE,
  ...
)

# S3 method for coxsplsDRmodel predict( object, newdata, comps = ncol(object$tt_splsDR), type = c("lp", "risk", "expected", "terms", "scores"), se.fit = FALSE, reference = c("strata", "sample", "zero"), y = NULL, weights = NULL, verbose = TRUE, ... )

# S3 method for coxDKsplsDRmodel predict( object, newdata, comps = ncol(object$tt_DKsplsDR), type = c("lp", "risk", "expected", "terms", "scores"), se.fit = FALSE, reference = c("strata", "sample", "zero"), y = NULL, weights = NULL, verbose = TRUE, ... )

Value

A vector, matrix or list of predictions depending on type and se.fit.

Arguments

object

An object returned by one of the DR-based fitting functions with allres = TRUE.

newdata

An optional data frame or matrix containing original covariates. If omitted, predictions are computed on the training data.

comps

Number of latent components to use for prediction.

type

Type of predicted value. Choices are the linear predictor ("lp"), the risk score exp(lp) ("risk"), the expected number of events ("expected"), the terms of the linear predictor ("terms") or the latent component scores ("scores").

se.fit

If TRUE, pointwise standard errors are produced by the underlying Cox model.

reference

Reference level used to center relative predictions. This is passed to predict.coxph and affects type = "lp", "risk" and "terms".

y

Optional Surv response to use with type = "expected" when predicting on genuinely new observations.

weights

Optional case weights used when rebuilding a model matrix for formula-based fits.

verbose

Should some details be displayed?

...

Additional arguments passed to predict.coxph.

See Also

predict.coxph, coxplsDR, coxsplsDR, coxDKsplsDR