# Random vs. fixed effect in glmer binomial model

I'm using a binomial glmer mixed effects model using and I have two questions.

One variable that I have, 'stimulus' has 12 levels. The levels were not randomly selected, so I have used it as a fixed variable in the basic model but R seems not to like it (at least this is my interpretation) given the way the output looks and the amount of time R takes to process it.

m0.1 <- glmer(match ~ Listgp + stimulus + (1|Listener), data = PATdata, family = "binomial")

summary(m0.1) Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) [ glmerMod] Family: binomial ( logit ) Formula: match ~ Listgp + stimulus + (1 | Listener) Data: PATdata
AIC      BIC   logLik deviance df.resid
5154.3 5259.5 -2562.2 5124.3 8193

Scaled residuals: Min 1Q Median 3Q Max -25.0764 -0.2706 -0.1939 0.2472 10.5131

Random effects: Groups Name Variance Std.Dev. Listener (Intercept) 1.743 1.32
Number of obs: 8208, groups: Listener, 228

Fixed effects: Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.7561 0.2657 10.371 < 2e-16 * ListgpTA 0.1741 0.3147 0.553 0.580128
ListgpTQ 0.0810 0.2575 0.315 0.753094
stimulushaaDD -5.4415 0.2071 -26.272 < 2e-16 stimulushad -4.2953 0.1822 -23.569 < 2e-16 stimulushaDD -5.4946 0.2086 -26.337 < 2e-16 stimulushid -5.1519 0.1994 -25.832 < 2e-16 stimulushiDD -0.6708 0.1801 -3.724 0.000196 stimulushiid -5.8124 0.2186 -26.593 < 2e-16 stimulushiiDD -5.5101 0.2091 -26.353 < 2e-16 stimulushud -0.2016 0.1915 -1.053 0.292345
stimulushuDD -5.6188 0.2123 -26.462 < 2e-16 stimulushuud -5.6107 0.2121 -26.450 < 2e-16 *

stimulushuuDD -5.3207 0.2038 -26.109 < 2e-16 ***

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

ListgpTQ -0.755 0.636
stimulushaDD -0.392 -0.007 0.003 0.555 0.601
stimulushid -0.407 -0.007 0.004 0.572 0.624 0.569
stimulushiDD -0.414 0.000 0.001 0.534 0.606 0.530
stimulushiid -0.376 -0.006 0.003 0.536 0.578 0.533
stimulushiiDD -0.391 -0.007 0.003 0.554 0.600 0.551
stimulushud -0.386 0.000 0.000 0.497 0.564 0.493
stimulushuDD -0.385 -0.007 0.003 0.548 0.592 0.545
stimulushuud -0.386 -0.007 0.003 0.548 0.593 0.545
stimulushuuDD -0.400 -0.007 0.004 0.564 0.613 0.561
stimulushid stimulushiDD stimulushiid stimulushiiDD stimulushud ListgpTA
ListgpTQ
stimulushid
stimulushiDD 0.554
stimulushiid 0.549 0.506
stimulushiiDD 0.568 0.529 0.533
stimulushud 0.516 0.569 0.471 0.492
stimulushuDD 0.562 0.521 0.527 0.544 0.484
stimulushuud 0.562 0.522 0.528 0.545 0.485
stimulushuuDD 0.579 0.543 0.542 0.560 0.505
stimulushuDD stimulushuud ListgpTA
ListgpTQ
stimulushid
stimulushiDD
stimulushiid
stimulushiiDD
stimulushud
stimulushuDD
stimulushuud 0.539
stimulushuuDD 0.554 0.554


So, my question is, can I consider 'stimulus' as a random effect instead?

m0.1 <- glmer(match ~ Listgp + (1|stimulus) + (1|Listener), data = PATdata, family = "binomial") summary(m0.1) Generalized linear mixed model fit by maximum likelihood (Laplace Approximation) [ glmerMod] Family: binomial ( logit ) Formula: match ~ Listgp + (1 | stimulus) + (1 | Listener) Data: PATdata
AIC      BIC   logLik deviance df.resid
5218.3 5253.4 -2604.2 5208.3 8203

Scaled residuals: Min 1Q Median 3Q Max -21.9276 -0.2804 -0.2059 0.2740 9.4275

Random effects: Groups Name Variance Std.Dev. Listener (Intercept) 1.676 1.294
stimulus (Intercept) 4.949 2.225
Number of obs: 8208, groups: Listener, 228; stimulus, 12

Fixed effects: Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.3754 0.6792 -2.025 0.0429 * ListgpTA 0.2284 0.3073 0.743 0.4572

ListgpTQ 0.1432 0.2513 0.570 0.5687

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

Correlation of Fixed Effects: (Intr) LstgTA ListgpTA -0.235
ListgpTQ -0.288 0.636

• What is your exact research question? Commented Oct 25, 2015 at 13:00
• Thanks Roland for the response. I'm testing whether the perceptions of three listener groups (Listgp; T, TA and TQ) would match already predicted perceptions based on corpus data. 'Match' is a binary predictor (match,mismatch) and is calculated by matching listener's response vowels to predicted vowels. Hope this makes sense. I'm confident about the variable 'listener' being a random effect but not sure about 'stimulus'.
Commented Oct 25, 2015 at 13:38
• I don't see any reason here that would prohibit using stimulus as a crossed random effect. Commented Oct 25, 2015 at 18:04
• Thanks again Ronald. My understanding about random effects is that they should have +100 levels and it should be sampled from a larger population. This is not the case in my data, as 'stimulus' has only 12 levels which are also selected intentionally for the purpose of the study., i.e., were not selected randomly.
Commented Oct 26, 2015 at 7:45
• Much appreciated Roland. I guess I needed to hear this line - "The question is not if the subjects were sampled randomly from a distribution, but if modeling them as a random sample results in a useful and sensible model" to ascertain my intuition. I already posted it in stackexchange.com but received no answer but that's ok for now. I will use stimulus as a random effect since indeed the 2nd model is more useful and sensible!
Commented Oct 26, 2015 at 8:07

Since there is no interest in the individual estimates for stimulus,and with 12 levels, it makes sense to fit random intercepts in for these data.