[R-sig-ME] Wald t-tests for glmer

Albyn Jones jones at reed.edu
Thu Dec 29 00:50:04 CET 2011


The Wald tests for coefficients are given in the summary table, labeled
"z value": \hat{\beta}/SE(\hat{\beta}).

albyn

Quoting Michael Allen <michaelcobballen at yahoo.com>:

> Dear List,
> I have a "Poisson-lognormal" mixed model (structure and output  
> below).  I would like to perform Wald t-tests to obtain P-values  
> for the parameter estimates.  I understand that one way to do this  
> is to use the z-scores provided by summary() as the t-values. My  
> question is what I should use as my df, given the model structure  
> below. The y-data are bird counts recorded during 646 surveys at 44  
> transect locations.  So each transect was surveyed multiple  
> times...thus, the inclusion of (1|trans), which is essentially the  
> "name" indicating which of the 44 transects were surveyed (e.g.,  
> L_01, W_04, etc.).  Data were overdispersed, so a random term  
> representing individual-level variation was included (i.e.,  
> (1|obs)).  Should the df for the t-tests be 646 - 1 = 645 or maybe  
> 44 - 1 = 43 ? Is there another way to calculate them? Am I even  
> doing the Wald tests correctly? Thanks in advance for your help.
>
> Mike
>
>
> library(lme4)
> library(arm)
> db$obs=1:nrow(db)
>
> b.dens.veg2=glmer(dens~year+site+de+avghtin1+I(avghtin1^2)+avghtin1*site+(1|trans)+(1|obs),data=db,family=poisson)
>
>> summary(b.dens.veg2)
> Generalized linear mixed model fit by the Laplace approximation
> Formula: dens ~ year + site + de + avghtin1 + I(avghtin1^2) +  
> avghtin1*site + (1 | trans) + (1 | obs)
>    Data: db
>    AIC   BIC logLik deviance
>  697.2 750.9 -336.6    673.2
> Random effects:
>  Groups Name        Variance Std.Dev.
>  obs    (Intercept) 0.094321 0.30712
>  trans  (Intercept) 0.049609 0.22273
> Number of obs: 646, groups: obs, 646; trans, 44
>
> Fixed effects:
>                Estimate Std. Error z value Pr(>|z|)   
> (Intercept)     0.36736    0.16844   2.181   0.0292 * 
> year2           0.17644    0.07472   2.361   0.0182 * 
> year3           0.02453    0.07537   0.326   0.7448   
> siteP           0.41106    0.22915   1.794   0.0728 . 
> siteW           0.31676    0.20634   1.535   0.1248   
> deE            -0.53292    0.08145  -6.543 6.02e-11 ***
> avghtin1        0.06967    0.18736   0.372   0.7100   
> I(avghtin1^2)   0.06706    0.05755   1.165   0.2440   
> siteP:avghtin1 -0.28355    0.17117  -1.657   0.0976 . 
> siteW:avghtin1  0.31147    0.16166   1.927   0.0540 . 
> ---
> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05  
> ‘.’ 0.1 ‘ ’ 1
>
> Correlation of Fixed Effects:
>             (Intr) year2  year3  siteP  siteW   
> deE    avght1 I(1^2) stP:v1
> year2        
> -0.161                                                       
> year3       -0.145   
> 0.591                                                
> siteP       -0.388 -0.124  
> -0.134                                         
> siteW       -0.612  0.070  0.067   
> 0.492                                  
> deE         -0.060 -0.002 -0.003 -0.007  
> -0.018                           
> avghtin1    -0.802 -0.045 -0.080  0.081  0.324  
> -0.006                    
> I(vghtn1^2)  0.437 -0.078 -0.007  0.381  0.085  0.007  
> -0.759             
> sitP:vghtn1  0.287  0.148  0.139 -0.848 -0.467 -0.002 -0.077  
> -0.512      
> sitW:vghtn1  0.542 -0.074 -0.071 -0.433 -0.864  0.018 -0.412 -0.076  0.551
>
> # my attempt at Wald t-tests, assuming 645 df (i.e., number of  
> observations minus 1)
>
>> t=fixef(b.dens.veg2)/se.fixef(b.dens.veg2)
>> p=data.frame(p=2*pt(abs(t),df=645,lower.tail=F))
>> data.frame(t,p)
>                         t            p
> (Intercept)     2.1809174 2.955005e-02
> year2           2.3613006 1.850732e-02
> year3           0.3255303 7.448853e-01
> siteP           1.7938740 7.330155e-02
> siteW           1.5351187 1.252450e-01
> deE            -6.5432216 1.227467e-10
> avghtin1        0.3718450 7.101304e-01
> I(avghtin1^2)   1.1651422 2.443921e-01
> siteP:avghtin1 -1.6565831 9.809013e-02
> siteW:avghtin1  1.9266674 5.446011e-02
>
> # my other attempt at Wald t-tests, assuming 43 df (i.e., number of  
> transects minus 1)
>
>> t=fixef(b.dens.veg2)/se.fixef(b.dens.veg2)
>> p=data.frame(p=2*pt(abs(t),df=43,lower.tail=F))
>> data.frame(t,p)
>                         t            p
> (Intercept)     2.1809174 3.470626e-02
> year2           2.3613006 2.281215e-02
> year3           0.3255303 7.463586e-01
> siteP           1.7938740 7.986700e-02
> siteW           1.5351187 1.320807e-01
> deE            -6.5432216 5.923002e-08
> avghtin1        0.3718450 7.118344e-01
> I(avghtin1^2)   1.1651422 2.503844e-01
> siteP:avghtin1 -1.6565831 1.048840e-01
> siteW:avghtin1  1.9266674 6.064659e-02
> 	[[alternative HTML version deleted]]
>
>




More information about the R-sig-mixed-models mailing list