# calculate effect size for fixed effect variable with >2 levels binomial glmm (lme4)

I have a mixed effects model with a binomial outcome which I constructed using glmer from the lme4 package in R. In the output from summary(model) I get estimates for each of the fixed effects. This is fine for continuous and dichotomous variables, however, for categorical variables with >2 levels this does not work (as the output produces contrasts). To get the effects for these, I use the anova or drop1 functions. However, these do not include any measure of effect size.

Using the effectsize package, I tried effectsize(model) which provides effect sizes and confidence intervals for the output produced by summary(model), however, what I am interested in is the global effect of a categorical variable with >2 levels (the equivalent to Cohen's d when conducting a normal ANOVA).

How can I calculate this?

• How would you define such a global effect size? Commented Aug 25, 2021 at 2:09
• the equivalent to cohen's d when conducting a normal ANOVA Commented Aug 25, 2021 at 7:28
• Please add that new information to the post as an edit! not only as a comment. Not everybody reads comments, and we want posts to be self-contained. Commented Aug 25, 2021 at 11:30

There aren't really global effect sizes for glm(m)s.

You can try Nagelkerke's pseudo-$$R^2$$. E.g.:

m1 <- glm(gear ~ hp, data = mtcars,
family = poisson())

m2 <- glm(gear ~ hp + am, data = mtcars,
family = poisson())

performance::r2(m1)
#> # R2 for Generalized Linear Regression
#>   Nagelkerke's R2: 0.017

performance::r2(m2)
#> # R2 for Generalized Linear Regression
#>   Nagelkerke's R2: 0.657


Created on 2022-01-13 by the reprex package (v2.0.1)