[ADMB Users] ICC calculation in glmmADMB R package

Sen Li sen.li at uclouvain.be
Tue Sep 13 04:09:06 PDT 2011


Dear Rafael

Thanks for the quick reply, it does provide me with something. But for 
the estimation of ICC, I don't know if the information is enough.

For example, when using VarCorr() in the "nlme" package, variances of 
both "intercept" and "residual" can be provided. The ICC is therefore 
calculated by: between group variance or intercept/(between group 
variance or intercept + within group variance or residual) (pp52-53, 
"Multilevel Modeling in R (ver 2.3)" by P Bliese).

When using "test2$S", I got this:
 > test2$S
             (Intercept)
(Intercept)      1.6267

If this gives me the "between group variance or intercept", it seems 
that I still need to get the residual variance for ICC calculation... 
How can I get this value? using var(resid(test2))?

I'm still new to R and multilevel modelling... apologise for being stupid.

With many thanks,
Sen


On 13/09/2011 12:20, Rafael Mares wrote:
> Is test2$S what you are looking for? I think it is similar to (or the
> same as?) VarCorr() but for glmm.ADMB models.
>
>
> --
> Rafael Mares
> Large Animal Research Group (LARG)
> Department of Zoology
> University of Cambridge
> Downing Street
> Cambridge
> CB2 3EJ
>
>
>
> On 13 September 2011 09:33, Sen Li<sen.li at uclouvain.be>  wrote:
>> Dear Ben,
>>
>> Thanks for the reply. I tried VarCorr() before, but it turned out to be
>> inapplicable with gimm.ADMB objects.
>>
>> Here follows the outputs of my model, of VarCorr(), and of sessionInfo():
>>
>>> print(test2,sd_S_print=T)
>> GLMM's in R powered by AD Model Builder:
>>
>>    Family: nbinom
>>    alpha = 1.0808
>>
>> Fixed effects:
>>    Log-likelihood: -690.741
>>    AIC: 1395.482
>>    Formula: y ~ x1 + x2 + x3
>>   (Intercept)           x1                x2                    x3
>>     11.048000    -0.025435   -45.852000    -0.061126
>>
>> Random effects:
>>    Grouping factor: Scode
>>    Formula: ~1
>> Structure: Diagonal matrix
>> (Intercept)
>>     1.275421
>>
>> Covariance matrix of random effects vector (left) and corresponding standard
>> deviations (right):
>>
>>              (Intercept)     (Intercept)
>> (Intercept)      1.6267         0.77551
>>
>> Note: The diagonal elements of the above left matrix are variances, NOT
>> std's.
>>
>> Number of Observations: 125
>> Number of Groups: 51
>>> VarCorr(test2)
>> Erreur dans UseMethod("VarCorr") :
>>    pas de méthode pour 'VarCorr' applicable pour un objet de classe
>> "glmm.admb" ## the method is not applicable to an object of class
>> "glmm.admb"##
>>> sessionInfo()
>> R version 2.13.0 (2011-04-13)
>> Platform: x86_64-pc-mingw32/x64 (64-bit)
>>
>> locale:
>> [1] LC_COLLATE=French_Belgium.1252  LC_CTYPE=French_Belgium.1252
>> [3] LC_MONETARY=French_Belgium.1252 LC_NUMERIC=C
>> [5] LC_TIME=French_Belgium.1252
>>
>> attached base packages:
>> [1] stats     graphics  grDevices utils     datasets  methods   base
>>
>> other attached packages:
>> [1] nlme_3.1-101   glmmADMB_0.5-2 MASS_7.3-12
>>
>> loaded via a namespace (and not attached):
>> [1] grid_2.13.0     lattice_0.19-23 tools_2.13.0
>> I'd appreciate any further help.
>>
>> Best,
>> Sen
>>
>> _______________________________________________
>> Users mailing list
>> Users at admb-project.org
>> http://lists.admb-project.org/mailman/listinfo/users
>>
>>





More information about the Users mailing list