predict.pcoxtime: Prediction for pcoxtime model

View source: R/posthocfuns.R

predict.pcoxtimeR Documentation

Prediction for pcoxtime model

Description

Compute fitted values and model terms for the pcoxtime model.

Usage

## S3 method for class 'pcoxtime'
predict(
  object,
  ...,
  newdata = NULL,
  type = c("lp", "risk", "expected", "terms", "survival"),
  terms = object$predictors,
  na.action = na.pass
)

Arguments

object

fitted pcoxtime object

...

for future implementations.

newdata

optional data frame containing the variables appearing on the right hand side of pcoxtime formula. If absent, the predictions are for the data frame used in the original fit.

type

the type of predicted value. Either linear predictor ("lp"), the risk score ("risk" equivalently exp(lp)), the expected number of events given the covariates and follow-up time ("expected"), the terms of linear predictor ("terms") and the survival probability for each individual ("survival").

terms

if type = "terms", this argument can be used to specify which terms to be return. Default is all.

na.action

defines the missing value action for the newdata. If newdata is absent, then the behavior of missing is dictated by the na.action option of the original fit.

Details

The computation of these predictions similar to those in predict.coxph. Our current implementation does not incorporate stratification.

Value

a vector of predictions, depending on the type.

Examples


data(heart, package="survival")
lam <- 0.1
alp <- 0.8
pfit <- pcoxtime(Surv(start, stop, event) ~ age + year + surgery + transplant
	, data = heart
	, lambda = lam
	, alpha = alp
)

predict(pfit, type = "lp")
predict(pfit, type = "expected")
predict(pfit, type = "risk")
predict(pfit, type = "survival")
predict(pfit, type = "terms")


pcoxtime documentation built on May 13, 2022, 1:05 a.m.