[R] frailtypack
cf2059
cef24 at pitt.edu
Thu Oct 10 13:14:51 CEST 2013
I wanted to provide a follow-up post regarding the question of the coxme
program and nested (multilevel) frailty analysis. As it turns out, my
failure to produce results was a result of my own error. The following
syntax seems to successfully produce results for a model accounting for both
clustering of recurrent events within individual (ID) and also individuals
within groups (GroupNum). Given that my dataset is over 15,000 rows in
length, the success of the program is no small feat (I attempted a similar
nested analysis with this data in two other R programs, and in both cases R
stopped working during the procedure)
library(coxme)
cgd.nfm<- coxme(Surv(Duration, Censoring) ~ Alcohol*Gender + (1 |
GroupNum/ID), data=mydata)
print(cgd.nfm)
My only remaining question concerns the relation between estimates provided
by coxme and those provided by a gamma shared frailty model run in SAS.
When I run identical shared frailty models in coxme and NLMIXED in SAS, the
estimates of fixed effects in coxme are slightly lower and the standard
errors are slightly higher. In reading the “Short Introduction to Coxme,” I
noticed mention of the Gaussian distribution. I wondered if differences in
the effects produced by coxme might be attributable to differences between
the Gaussian and the gamma distributions. (Forgive me if these questions are
misinformed or rudimentary—this is an entirely new field to me.) I also
wondered if there was a way to adjust the syntax of coxme such that the
estimates more closely approximate those produced by NLMIXED or,
alternatively, if there are reasons for believing the results produced by
coxme would be superior.
cf2059 wrote
> Thank you very much for responding. Yes, I incorrectly stated that
> frailtypack was the only widely available software for the analysis of
> nested frailty models. When I initially began my search to identify
> software well suited to nested frailty analysis, Frailtypack dominated the
> google results. While this package seems to be widely publicized on the
> internet, I have not thus far found it to be well suited to analysis with
> my large dataset.
>
> I would like to use coxme to analyze my data, as it appears to have far
> fewer idiosyncrasies than Frailtypack. However, at the moment I am
> struggling to 1) achieve model convergence with even a basic shared
> frailty model and 2) produce the correct code for the nested frailty
> model. My dataset involves recurrent events clustered within individuals
> (ID) and individuals then clustered within groups of three (GroupNum). One
> independent variable (Alcohol) varies by group and another (Gender) varies
> by individual. I ultimately aim to produce a nested frailty model that
> includes one random intercept variance term at the level of the individual
> and one at the level of the group. I have already produced results for a
> basic shared frailty model using SAS NLMIXED--a model that accounts for
> clustering only at the level of the Group using group-level predictors
> (Alcohol)--but so far I have not been able to achieve convergence for this
> same model using coxme. I suspect that supplying the program with starting
> values might be useful, but I am not familiar enough with the program code
> to do so. Any suggestions would be very much appreciated. I am new to
> survival analysis as well as the R software program.
>
> ##Basic Shared Frailty Model
>> cgd.nfm <- coxme(Surv(Duration, Censoring) ~ Alcohol + (1 | ID),
>> data=mydata)
>> summary(cgd.nfm)
> Length Class Mode
> coefficients 1 -none- numeric
> frail 1 -none- list
> penalty 1 -none- numeric
> loglik 3 -none- numeric
> variance 1 bdsmatrix S4
> df 2 -none- numeric
> hmat 1 gchol.bdsmatrix S4
> iter 2 -none- numeric
> control 9 -none- list
> u 709 -none- numeric
> means 1 -none- numeric
> scale 1 -none- numeric
> linear.predictor 15831 -none- numeric
> vcoef 1 -none- list
> n 2 -none- numeric
> terms 3 terms call
> formulaList 2 -none- list
> y 31662 Surv numeric
> call 3 -none- call
> ties 1 -none- character
>
> Nested Frailty Model
>> cgd.nfm <- coxme(Surv(Duration, Censoring) ~ Alcohol*Gender + (1 |
>> GroupNum/ID), data=mydata)
>> summary(cgd.nfm)
> Length Class Mode
> coefficients 1 -none- numeric
> frail 2 -none- list
> penalty 1 -none- numeric
> loglik 3 -none- numeric
> variance 1 bdsmatrix S4
> df 2 -none- numeric
> hmat 1 gchol.bdsmatrix S4
> iter 2 -none- numeric
> control 9 -none- list
> u 947 -none- numeric
> means 1 -none- numeric
> scale 1 -none- numeric
> linear.predictor 15831 -none- numeric
> vcoef 2 -none- list
> n 2 -none- numeric
> terms 3 terms call
> formulaList 2 -none- list
> y 31662 Surv numeric
> call 3 -none- call
> ties 1 -none- character
> Terry Therneau-2 wrote
>> I can't comment on frailtypack issues, but would like to mention that
>> coxme will handle
>> nested models, contrary to the statement below that "frailtypack is
>> perhaps the only ....
>> for nested survival data".
>> To reprise the original post's model
>>
>> cgd.nfm <- coxme(Surv(Tstart, Tstop, Status) ~ Treatment + (1 |
>> Center/ID), data=cgd.ag)
>>
>>
>> And a note to the poster-- you should reprise the original message to
>> which you are
>> responding.
>>
>>
>> Terry Therneau
>>
>> On 10/09/2013 05:00 AM,
>> r-help-request@
>> wrote:
>>> Hello,
>>>
>>> I am encountering very similar problems with frailtypack (only, it
>>> seems, 3
>>> years later). I would be incredibly grateful if you would be willing to
>>> share any solutions you happened upon for the problem you mention. I
>>> have a
>>> datafile that is even longer than yours (over 15000 events). Events
>>> follow a
>>> two-level nesting structure. When I attempt to run the nested survival
>>> model
>>> in frailtypack the program either stops running entirely or produces an
>>> error message. I have contacted the frailtypack maintainer but have not
>>> yet
>>> received a response. It seems that frailtypack is perhaps the only
>>> widely-available platform for the analysis of nested survival data, so
>>> the
>>> seeming bugginess of this program is troubling. Please let me know if
>>> you
>>> ended up coming up with a solution to your problem or, alternatively,
>>> another program able to run the nested analysis. Thank you so much!
>>>
>>
>> ______________________________________________
>> R-help@
>> mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
--
View this message in context: http://r.789695.n4.nabble.com/frailtypack-tp2328606p4677967.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list