My data has a binary response (correct/incorrect), one continuous predictor score
, three categorical predictors (race
, sex
, emotion
) and a random intercept for the random factor subj
. All predictors are within-subject. One of the categorical factor has 3 levels, the other have two.
I need advice on obtaining "global" p-values for each categorical factor (in an "ANOVA like" way)
Here is how I proceed :
I fitted a binomial GLMM using 'glmer' from the lme4 package (because 'glmmML' doesn't compute on my data and glmmPQL does not provide AIC) and did model selection using drop1
repeatedly until no more terms can be dropped. Here is the final model (let's assume it has been validated):
library(lme4)
M5 <- glmer(acc ~ race + sex + emotion + sex:emotion + race:emotion + score +(1|subj),
family=binomial, data=subset)
# apparently using family with lmer is deprecated
drop1(M5, test="Chisq")
summary(M5)
drop1
gives p-values for the higher level terms only (the two 2-way interactions + score
).
summary
gives p-values for every term, but separates the different levels of each categorical factor.
How can I get "global" p-values for each factor? I need to report them even if they are not the most relevant or meaningful estimates of signifiance here. How should I proceed? I tried searching on the web and ended up reading about likelihood ratios or the "Wald test" but I am not sure if or how this would apply here.
(PS: This is a duplicate from my "anonymous" post here that needed editing: https://stats.stackexchange.com/questions/90487/binomial-mixed-model-with-categorical-predictors-model-selection-and-getting-p Sorry about that.)
afex::mixed
as inmixed(acc ~ race + sex + emotion + sex:emotion + race:emotion + score +(1|subj), family=binomial, data=subset, method = "LRT")
. To obtain p-values based on parametric bootstrap, you can usemethod = "PB"
(but you will need to set the number of samples, see help). Also, you most likely need random slopes for your within-subject factors. Your random effects structure seems unreasonable! $\endgroup$ – Henrik Mar 19 '14 at 0:46?pvalues
in thelme4
package ... ? in addition toafex::mixed
, it also suggestscar::Anova
andlmerTest::anova
... $\endgroup$ – Ben Bolker Mar 19 '14 at 2:42?pvalues
help section. However, apparently neithercar::Anova
(which I had tried prior to posting) norlmer::anova
work for GLMMs. $\endgroup$ – user42174 Mar 19 '14 at 8:23mixed(acc ~ race + sex + emotion + sex:emotion + race:emotion + score +(1+sex|subj), family=binomial, data=subset, type = 3, method = "LRT")
as suggested (after selecting random then fixed effects) but this gives an error:Fitting 8 (g)lmer() models: [. Erreur dans lme4::glFormula(formula = acc ~ 0 + m.matrix[, -1L] + (1 + sex | : rank of X = 10 < ncol(X) = 16
I don't think my design matrix is wrong. Have you encountered this error before? $\endgroup$ – user42174 Mar 19 '14 at 10:33