| Title: | Estimation and Additional Tools for Alternative Shared Frailty Models |
|---|---|
| Description: | Provide estimation and data generation tools for new multivariate frailty models. This version includes the gamma, inverse Gaussian, weighted Lindley, Birnbaum-Saunders, truncated normal, mixture of inverse Gaussian, mixture of Birnbaum-Saunders, generalized exponential and Jorgensen-Seshadri-Whitmore as the distribution for frailty terms. For the basal model, it is considered a parametric approach based on the exponential, Weibull and the piecewise exponential distributions as well as a semiparametric approach. For details, see Gallardo et al. (2024) <doi:10.1007/s11222-024-10458-w>, Gallardo et al. (2025) <doi:10.1002/bimj.70044>, Kiprotich et al. (2025) <doi:10.1177/09622802251338984> and Gallardo et al. (2025) <doi:10.1038/s41598-025-15903-y>. |
| Authors: | Diego Gallardo [aut, cre], Marcelo Bourguignon [aut], John Santib<c3><a1><c3><b1>ez [ctb], Gilbert Kiprotich [ctb], Pedro Ramos [ctb], Thomas Augustin [ctb], Zohreh Mohammadi [ctb] |
| Maintainer: | Diego Gallardo <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.14 |
| Built: | 2026-05-22 06:27:05 UTC |
| Source: | https://github.com/cran/extrafrail |
Provides the baseline cumulative hazard function () for an object with extrafrail class.
baseCH(t, fit)baseCH(t, fit)
t |
the vector of times for which the baseline cumulative hazard function should be computed. |
fit |
an object with extrafrail class. |
Provides the baseline cumulative hazard function. When the baseline distribution is assumed as
the Weibull model, this function is . For the piecewise
exponential model, this function is ,
where if , if
and if , with the
corresponding partition time.
a vector with the same length that t, including the baseline cumulative hazard function related to t.
Diego Gallardo and Marcelo Bourguignon.
Gallardo, D.I., Bourguignon, M., Santibanez, J.L. (2025) The multivariate weighted Lindley frailty model for cluster failure time data. Biometrical Journal, 67(2), e70044.
#require(frailtypack) require(survival) data(rats, package="frailtyHL") #Example for WL frailty model fit.WL <- frailty.fit(survival::Surv(time, status) ~ rx + survival::cluster(litter), dist.frail="WL", data = rats) baseCH(c(80,90,100),fit.WL)#require(frailtypack) require(survival) data(rats, package="frailtyHL") #Example for WL frailty model fit.WL <- frailty.fit(survival::Surv(time, status) ~ rx + survival::cluster(litter), dist.frail="WL", data = rats) baseCH(c(80,90,100),fit.WL)
frailty.fit computes the maximum likelihood estimates based on the EM algorithm for the shared gamma, inverse gaussian, weighted Lindley, Birnbaum-Saunders, truncated normal, mixture of inverse gaussian and mixture of Birbaum-Saunders frailty models.
frailty.fit(formula, data, dist.frail="gamma", dist = "np", prec = 1e-04, max.iter = 1000, part=NULL)frailty.fit(formula, data, dist.frail="gamma", dist = "np", prec = 1e-04, max.iter = 1000, part=NULL)
formula |
A formula that contains on the left hand side an object of the type Surv and on the right hand side a +cluster(id) statement, possibly with the covariates definition. |
data |
A data.frame in which the formula argument can be evaluated |
dist.frail |
the distribution assumed for the frailty. Supported values: gamma (GA also is valid), IG (inverse gaussian), WL (weighted Lindley), BS (Birnbaum-Saunders), TN (truncated normal), MIG (mixture of IG), MBS (mixture of BS), GE (generalized exponential) and JSW (Jorgensen-Seshadri-Whitmore). |
dist |
the distribution assumed for the basal model. Supported values: weibull, pe (piecewise exponential), exponential and np (non-parametric). |
prec |
The convergence tolerance for parameters. |
max.iter |
The maximum number of iterations. |
part |
partition time (only for piecewise exponential distribution). |
The multiplicative frailty models are defined in the following way.
Consider the time to the event of an individual to be denoted by a random variable , where the latent effect
acts multiplicative in the baseline hazard function, whose hazard function, conditional on a latent variable ,
satisfies
where is a baseline hazard function and is the frailty of the individual, and
is the cumulative baseline hazard function.
Let , , be the latent random variable representing the frailty term associated with the -th cluster,
which has observations (note that the 's can be different, i.e., the cluster can be unbalanced).
The case , , is known in the literature as the univariate case.
In a multiplicative hazards framework, given and a vector of covariates (without intercept term), say
, the conditional hazard function for the observations in the -th cluster is given by
where are the regression parameters, respectively, and the distribution of
corresponds to a nonnegative random variable. In this package, it is considered such as and Var.
The options avaliable for the distribution of and the corresponding probability density function are:
- gamma:
- IG:
- WL (Mota et al; 2021 for the univariate case; Tyagi et al., 2021 for the bivariate case, Gallardo et al. 2025 for the general case):
where and .
- BS (Leao et al; 2021 for the univariate case; Gallardo et al., 2024 for the general case):
where .
The marginal survival function for the times in a same cluster can be expressed in terms of the Laplace transform as
For the different models considered here, the Laplace transform is given by
- gamma:
- IG:
- WL:
- BS:
The estimation is performed based on the EM algorithm. For the weibull, exponential and piecewise exponential distributions
as the basal model (), the M1-step is performed using the optim function. For the non-parametric case,
the M1-step is based on the coxph function from the survival package.
an object of class "extrafrail" is returned. The object returned for this functions is a list containing the following components:
coefficients |
A named vector of coefficients |
se |
A named vector of the standard errors for the estimated coefficients. |
t |
The vector of times. |
delta |
The failure indicators. |
id |
A variable indicating the cluster which belongs each observation. |
x |
The regressor matrix based on cov.formula (without intercept term). |
dist |
The distribution assumed for the basal model. |
dist.frail |
The distribution assumed for the frailty variable. |
tau |
The Kendall's tau coefficient. |
logLik |
The log-likelihood function (only when the Weibull model is specified for the basal distribution). |
Lambda0 |
The observed times and the associated cumulative hazard function (only when the non-parametric option is specified for the basal distribution) |
part |
the partition time (only for piecewise exponential model). |
Diego Gallardo, Marcelo Bourguignon and John Santibanez.
Gallardo, D.I., Bourguignon, M., Santibanez, J.L. (2025) The shared weighted Lindley frailty model for cluster failure time data. Biometrical Journal, 67, e70044.
Gallardo, D.I., Bourguignon, M., Romeo, J. (2024) Birnbaum-Saunders frailty regression models for clustered survival data. Statistics and Computing, 34, 141.
Leao, J., Leiva, V., Saulo, H., Tomazella, V. (2017). Birnbaum-Saunders frailty regression models: Diagnostics and application to medical data. Biometrical journal, 59, 291-317.
Mota, A., Milani, E., Calsavara, V., Tomazella, V., Leao, J., Ramos, P., Ferreira, P., F., L. (2021). Weighted lindley frailty model: estimation and application to lung cancer data. Lifetime Data Analysis, 27, 561-587.
Tyagi, S., Pandey, A., Agiwal, V., Chesneau, C. (2021). Weighted Lindley multiplicative regression frailty models under random censored data. Computational and Applied Mathematics, 40, 265.
require(survival) #require(frailtyHL) data(rats, package="frailtyHL") #Fit for WL frailty model fit.WL <- frailty.fit(survival::Surv(time, status)~ rx+ survival::cluster(litter), dist.frail="WL", data = rats) summary(fit.WL) #Fit for gamma frailty model fit.GA <- frailty.fit(survival::Surv(time, status) ~ rx + survival::cluster(litter), dist.frail="gamma", data = rats) summary(fit.GA)require(survival) #require(frailtyHL) data(rats, package="frailtyHL") #Fit for WL frailty model fit.WL <- frailty.fit(survival::Surv(time, status)~ rx+ survival::cluster(litter), dist.frail="WL", data = rats) summary(fit.WL) #Fit for gamma frailty model fit.GA <- frailty.fit(survival::Surv(time, status) ~ rx + survival::cluster(litter), dist.frail="gamma", data = rats) summary(fit.GA)
Generated random variables from the weighted Lindley distribution with mean 1.
rWL(n, theta = 1)rWL(n, theta = 1)
n |
number of observations. If length(n) > 1, the length is taken to be the number required. |
theta |
variance of the variable. |
The weighted Lindley distribution has probability density function
where and . Under
this parametrization, E(Z)=1 and Var(Z)=.
a vector of length n with the generated values.
Diego Gallardo and Marcelo Bourguignon.
Gallardo, D.I., Bourguignon, M. (2022) The multivariate weighted Lindley frailty model for cluster failure time data. Submitted.
rWL(10, theta=0.5)rWL(10, theta=0.5)
Summarizes the results for a object of the "extrafrail" class.
## S3 method for class 'extrafrail' summary(object, ...)## S3 method for class 'extrafrail' summary(object, ...)
object |
an object of the "extrafrail" class. |
... |
for extra arguments. |
Supported frailty models are: - gamma frailty model - inverse gaussian frailty model - weighted frailty model - Birnbaum-Saunders frailty model - Truncated normal frailty model - Mixture of inverse gaussian frailty model - Mixture of Birnbaum-Saunders frailty model
A complete summary for the coefficients extracted from a "extrafrail" object.
Diego Gallardo and Marcelo Bourguignon.
Gallardo and Bourguignon (2022).
#require(frailtyHL) require(survival) data(rats, package="frailtyHL") fit <- frailty.fit(survival::Surv(time, status) ~ rx + survival::cluster(litter), dist.frail="WL", data = rats) summary(fit)#require(frailtyHL) require(survival) data(rats, package="frailtyHL") fit <- frailty.fit(survival::Surv(time, status) ~ rx + survival::cluster(litter), dist.frail="WL", data = rats) summary(fit)