Hello list,

 

I have a GLMM with a within-subjects fixed factor (cadcats = 5 levels) and a
between-subjects fixed factor (trainings = 2 levels) and a maximal random
effects structure. I would like to run an “ANOVA-style” GLMM, and Barr
(2013) has said that one should use deviation coding to do this. I have 4
questions (my R code and model summary is below the questions).

 

1.      I have used sum coding (contr.sum), but deviation coding appears to
be slightly different. Moreover, sum coding results in the loss of the last
level of my factor (because it is a contrast, so n-1 groups means I can only
have 4 contrasts). How do I deviation code my factors, and will it also
result in the loss of the last level of my factor? I would prefer a method
that allows me to retain all levels in the summary.

2.      How do I interpret the summary for variables that have been sum
coded? Florian Jaeger has said that “for sum coding… the coefficients
correspond to main effects.” In my output does this mean that a significant
effect of cadcat1 means that the estimated mean for cadcat1 is significantly
different from the grand mean, which is represented by the intercept? 

3.      Is there a way to do omnibus tests for GLMMs (like pamer.fnc does
for LMMs)?

4.      My last question is perhaps the most frustrating for the experts on
this list to answer, but I would greatly appreciate your help. I would also
like to report significance levels in the tables that summarize my LMMs
(it’s a priming study, with GLMMs for accuracy and LMMs for logRT), but of
course lmer does not provide pvalues in the model summary. In spite of the
authors discontinuing mcmcsamp, most of the priming studies from the last 2
years appearing in the Journal of Memory and Language still report pvalues
for the model estimates (see, for example, Table 5 from Nooteboom & Quené,
2013), but I don’t know how they did this. I would omit the pvalues, but I
am publishing in music psychology, and these models are only just beginning
to appear in our field, so any help or code people would be willing to
provide would be much appreciated.

 

David Sears

PhD Candidate, Music Theory

Music Perception and Cognition Lab (MPCL)

Centre for Interdisciplinary Research in Music Media and Technology (CIRMMT)
Schulich School of Music, McGill University

 

 

CODE 

 

# Create factor variables.

acc$subject <- factor(acc$subject)

acc$training <- factor(acc$training)

acc$correct <- factor(acc$correct)

acc$cadcat <- factor(acc$cadcat)

 

# Create IVs with sum coding.

acc$trainings <- acc$training

contrasts(acc$trainings)=contr.sum(2)

acc$cadcats <- acc$cadcat

contrasts(acc$cadcats)=contr.sum(5)

 

# Maximal model.

cadsum.acc <-
glmer(correct~cadcats*trainings+(cadcats|subject)+(trainings|stimulus),data=
acc,family="binomial",control=glmerControl(optCtrl=list(maxfun=100000)))

 

 

> summary(cadsum.acc)

Generalized linear mixed model fit by maximum likelihood ['glmerMod']

Family: binomial ( logit )

Formula: correct ~ cadcats * trainings + (cadcats | subject) + (trainings |
stimulus) 

   Data: acc 

 

      AIC       BIC    logLik  deviance 

 789.5965  931.7901 -366.7983  733.5965 

 

Random effects:

Groups   Name        Variance Std.Dev. Corr                   

 stimulus (Intercept) 0.84853  0.9212                          

          trainings1  0.01080  0.1039   -0.85                  

 subject  (Intercept) 0.43439  0.6591                          

          cadcats1    0.55165  0.7427   -0.34                  

          cadcats2    0.76990  0.8774    0.31  0.52            

          cadcats3    1.32294  1.1502   -0.09 -0.23 -0.85      

          cadcats4    0.06946  0.2635   -0.42 -0.69 -0.64  0.14

Number of obs: 1186, groups: stimulus, 40; subject, 30

 

Fixed effects:

                    Estimate Std. Error z value Pr(>|z|)    

(Intercept)          2.63867    0.22993  11.476  < 2e-16 ***

cadcats1             1.01518    0.44687   2.272   0.0231 *  

cadcats2             0.59321    0.42280   1.403   0.1606    

cadcats3             0.54040    0.44940   1.202   0.2292    

cadcats4            -0.69632    0.36178  -1.925   0.0543 .  

trainings1           0.79023    0.17559   4.500 6.78e-06 ***

cadcats1:trainings1 -0.71485    0.32224  -2.218   0.0265 *  

cadcats2:trainings1 -0.48321    0.30379  -1.591   0.1117    

cadcats3:trainings1 -0.22673    0.33094  -0.685   0.4933    

cadcats4:trainings1  0.08375    0.21199   0.395   0.6928    

---

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

 

Correlation of Fixed Effects:

            (Intr) cdcts1 cdcts2 cdcts3 cdcts4 trnng1 cdc1:1 cdc2:1 cdc3:1

cadcats1     0.047                                                        

cadcats2     0.078 -0.187                                                 

cadcats3    -0.006 -0.284 -0.368                                          

cadcats4    -0.123 -0.282 -0.239 -0.187                                   

trainings1   0.063 -0.035 -0.004  0.021 -0.004                            

cdcts1:trn1 -0.037  0.006  0.011 -0.010  0.004  0.040                     

cdcts2:trn1 -0.005  0.012  0.054 -0.029 -0.015  0.151 -0.116              

cdcts3:trn1  0.022 -0.009 -0.028  0.100 -0.031 -0.035 -0.291 -0.467       

cdcts4:trn1 -0.006  0.006 -0.018 -0.039  0.103 -0.256 -0.317 -0.244 -0.110

 

 


	[[alternative HTML version deleted]]

