Description Usage Arguments Details References Examples
frailtyHL is used to fit frailty models using h-likelihood estimation procedures. For the frailty distribution lognormal and gamma are allowed. In particular, nested (multilevel) frailty models allow survival studies for hierarchically clustered data by including two iid normal random effects. The h-likelihood uses the Laplace approximation when the numerical integration is intractable, giving a statistically efficient estimation in frailty models (Ha, Lee and Song, 2001; Ha and Lee, 2003, 2005; Lee, Nelder and Pawitan, 2017).
1 2 3 |
formula |
A formula object, with the response on the left of a ~ operator, and the terms for the fixed and random effects on the right. e.g. formula=Surv(time,status)~x+(1|id), time : survival time, status : censoring indicator having 1 (0) for uncensored (censored) observation, x : fixed covariate, id : random effect. |
data |
Dataframe for formulaMain. |
weights |
Vector of case weights. |
subset |
Expression indicating which subset of the rows of data should be used in the fit. All observations are included by default. |
na.action |
A missing-data filter function. |
RandDist |
Distribution for random effect ("Normal" or "Gamma"). |
mord |
The order of Laplce approximation to fit the mean parameters (0 or 1); default=0. |
dord |
The order of Laplace approximation to fit the dispersion components (1 or 2); default=1. |
Maxiter |
The maximum number of iterations; default=200. |
convergence |
Specify the convergence criterion, the default is 1e-6. |
varfixed |
Logical value: if TRUE (FALSE), the value of one or more of the variance terms for the frailties is fixed (estimated). |
varinit |
Starting values for frailties, the default is 0.1. |
varnonneg |
Logical value: if TRUE (FALSE), gives zero (NaN) SE for random effects when they are estimated by zeros |
frailtyHL package produces estimates of fixed effects and frailty parameters as well as their standard errors. Also, frailtyHL makes it possible to fit models where the frailty distribution is normal and gamma and estimate variance components when frailty structure is allowed to be shared or nested.
Ha, I. D. and Lee, Y. (2003). Estimating frailty models via Poisson Hierarchical generalized linear models. Journal of Computational and Graphical Statistics, 12, 663-681.
Ha, I. D. and Lee, Y. (2005). Comparison of hierarchical likelihood versus orthodox best linear unbiased predictor approaches for frailty models. Biometrika, 92, 717-723.
Ha, I. D., Lee, Y. and Song, J. K. (2001). Hierarchical likelihood approach for frailty models. Biometrika, 88, 233-243.
Lee, Y., Nelder, J. A. and Pawitan, Y. (2017). Generalised linear models with random effects: unified analysis via h-likelihood. 2nd Edition. Chapman and Hall: London.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | #### Analysis of kidney data
data(kidney)
#### Normal frailty model using order = 0, 1 for the mean and dispersion
kidney_ln01<-frailtyHL(Surv(time,status)~sex+age+(1|id),kidney,
RandDist="Normal",mord=0,dord=1)
#### Normal frailty model using order = 1, 1 for the mean and dispersion
#kidney_ln11<-frailtyHL(Surv(time,status)~sex+age+(1|id),kidney,
#RandDist="Normal",mord=1,dord=1)
#### Gamma frailty model using order = 0, 2 for the mean and dispersion
#kidney_g02<-frailtyHL(Surv(time,status)~sex+age+(1|id),kidney,
#RandDist="Gamma",mord=0,dord=2)
#### Gamma frailty model using order = 1, 2 for the mean and dispersion
#kidney_g12<-frailtyHL(Surv(time,status)~sex+age+(1|id),kidney,
#RandDist="Gamma",mord=1,dord=2)
#### Analysis of rats data
data(rats)
#### Cox model
rat_cox<-frailtyHL(Surv(time,status)~rx+(1|litter),rats,
varfixed=TRUE,varinit=c(0))
#### Normal frailty model using order = 1, 1 for the mean and dispersion
#rat_ln11<-frailtyHL(Surv(time,status)~rx+(1|litter),rats,
#RandDist="Normal",mord=1,dord=1,varinit=c(0.9))
#### Gamma frailty model using order = 1, 2 for the mean and dispersion
#rat_g12<-frailtyHL(Surv(time,status)~rx+(1|litter),rats,
#RandDist="Gamma",mord=1,dord=2,convergence=10^-4,varinit=c(0.9))
#### Analysis of CGD data
data(cgd)
#### Multilevel normal frailty model using order = 1, 1 for the mean and dispersion
#cgd_ln11<-frailtyHL(Surv(tstop-tstart,status)~treat+(1|center)+(1|id),cgd,
#RandDist="Normal",mord=1,dord=1,convergence=10^-4,varinit=c(0.03,1.0))
|
Loading required package: Matrix
Loading required package: survival
Loading required package: cmprsk
iteration :
46
convergence :
7.61095e-07
[1] "converged"
[1] "Results from the log-normal frailty model"
[1] "Number of data : "
[1] 76
[1] "Number of event : "
[1] 58
[1] "Model for conditional hazard : "
Surv(time, status) ~ sex + age + (1 | id)
[1] "Method : HL(0,1)"
[1] "Estimates from the mean model"
Estimate Std. Error t-value p-value
sex -1.380431 0.43082 -3.2042 0.001354
age 0.004885 0.01209 0.4041 0.686123
[1] "Estimates from the dispersion model"
Estimate Std. Error
id 0.5345 0.3384
-2h0 -2*hp -2*p_b,v(hp)
[1,] 330.4 390.77 371.54
cAIC pAIC rAIC
[1,] 362.46 370.7 373.54
iteration :
4
convergence :
4.801639e-09
[1] "converged"
[1] "Results from the Cox model"
[1] "Number of data : "
[1] 150
[1] "Number of event : "
[1] 40
[1] "Model for conditional hazard : "
Surv(time, status) ~ rx + (1 | litter)
[1] "Method : HL(0,1)"
[1] "Estimates from the mean model"
Estimate Std. Error t-value p-value
rx 0.8982 0.3174 2.83 0.004655
[1] "Estimates from the dispersion model"
Estimate Std. Error
litter "0" "NULL"
-2h0 -2*hp -2*p_b,v(hp)
[1,] 363.69 363.69 364.15
cAIC pAIC rAIC
[1,] 365.69 365.69 364.15
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.