| loglik_frailty | R Documentation |
Computes the log-likelihood for shared frailty models across all 10 baseline-frailty combinations with support for right, exact, left, and interval censoring, plus optional progressive censoring.
loglik_frailty(
par_all,
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
)
par_all |
Vector of all model parameters on estimation scale (log/logit transformed). |
time |
Primary event/censoring time vector. |
status |
Event status vector (0 = right-censored, 1 = exact event, 2 = left-censored, 3 = interval-censored). |
x |
Matrix of covariates (n x p). Default is 0-column matrix. |
baseline |
Baseline hazard distribution ( |
frailty |
Frailty distribution ( |
time2 |
Vector of upper interval bounds when |
prog_cen |
Vector of progressive censoring counts R_i per observation. Default is NULL. |
Scalar log-likelihood value. Returns -1e12 sentinel on numerical invalidity.
par_all <- c(log(2), log(1.5), log(0.8), 0.1) # Weibull + Gamma + 1 beta
time <- c(1, 2, 3, 4)
status <- c(1, 0, 1, 0)
x <- matrix(c(0.5, -0.2, 0.1, 0.8), ncol = 1)
ll <- loglik_frailty(par_all, time, status, x, baseline = "weibull", frailty = "gamma")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.