fit_frailty: Low-Level Maximum Likelihood Estimator for MultiFrailty...

View source: R/fit.R

fit_frailtyR Documentation

Low-Level Maximum Likelihood Estimator for MultiFrailty Models

Description

Fits shared frailty regression models using Maximum Likelihood Estimation (MLE) across all 10 baseline-frailty combinations with robust optimizer fallbacks.

Usage

fit_frailty(
  time,
  status,
  x = matrix(nrow = length(time), ncol = 0),
  baseline = c("weibull", "gw"),
  frailty = c("none", "gamma", "ig", "gl1", "gl2"),
  time2 = NULL,
  prog_cen = NULL,
  init = NULL,
  method = "NR",
  ...
)

Arguments

time

Primary survival/censoring time vector.

status

Event indicator vector (0 = right-censored, 1 = event, 2 = left-censored, 3 = interval-censored).

x

Design matrix of covariates (n x p). Default is a 0-column matrix.

baseline

Character string for baseline hazard: "weibull" or "gw".

frailty

Character string for frailty family: "none", "gamma", "ig", "gl1", or "gl2".

time2

Vector of upper interval bounds when status == 3. Default is NULL.

prog_cen

Vector of progressive censoring counts. Default is NULL.

init

Vector of initial values on the estimation scale. Default is NULL (automatic).

method

Optimization method passed to maxLik: "NR" (Newton-Raphson) or "BFGS".

...

Additional arguments passed to optimization algorithms.

Value

An object of class "multifrailty_fit" containing parameter estimates, standard errors, information criteria, variance-covariance matrix, and diagnostic statistics.

References

Hougaard, P. (1984). Life table methods for heterogeneous populations: distributions of frailties. Biometrika, 71(1), 75-83.

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 = 100, baseline = "weibull", bpar = c(2, 1.5),
                 frailty = "gamma", fpar = c(0.8),
                 x = matrix(rnorm(100), ncol = 1), beta = 0.5)
fit <- fit_frailty(time = dat$time, status = dat$status, x = as.matrix(dat[, "X1", drop=FALSE]),
                   baseline = "weibull", frailty = "gamma")
print(fit)

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