predict_frailty: Predictions for MultiFrailty Regression Models

View source: R/predict.R

predict_frailtyR Documentation

Predictions for MultiFrailty Regression Models

Description

Computes survival probabilities, hazard rates, median survival times, expected survival times, risk scores, marginal survival curves, or future survival forecasts for a fitted multifrailty model.

Usage

predict_frailty(
  fit,
  newdata = NULL,
  newtime = NULL,
  type = c("survival", "hazard", "median", "expected", "risk", "marginal", "forecast"),
  window = NULL
)

Arguments

fit

A fitted object of class "multifrailty_fit".

newdata

Optional data frame of new covariate values. If NULL, uses training data.

newtime

Optional vector of evaluation time points. If NULL, uses default grid.

type

Type of prediction: "survival", "hazard", "median", "expected", "risk", "marginal", or "forecast".

window

Optional forecast window or horizon parameter.

Value

Vector or matrix of predictions depending on type.

References

Pandey, A., Hanagal, D. D., & Tyagi, S. (2022). Shared Frailty Models Based on Cancer Data. International Journal of Statistics and Reliability Engineering, 9(3), 461-474.

Pandey, A., & Tyagi, S. (2021). Comparison of Multiplicative Frailty Models Under Weibull Baseline Distribution. Lobachevskii Journal of Mathematics, 42(13), 3184-3195.

Examples

set.seed(123)
dat <- r_frailty(n = 60, baseline = "weibull", bpar = c(2, 1.5), frailty = "gamma", fpar = c(0.8))
fit <- fit_frailty(time = dat$time, status = dat$status, baseline = "weibull", frailty = "gamma")
pred_surv <- predict_frailty(fit, type = "survival", newtime = c(1, 2, 3))

MultiFrailty documentation built on Aug. 8, 2026, 1:07 a.m.