Summary() function splits factor levels when there are only two contrast-coded levels

38 views Asked by At

I am running a mixed-effects model in R usuing lme4/lmerTest. My model has the following formula:

model1 = lmer(DV ~ FactorA + FactorB + Continuous IV 1 + Continuous IV 2 + 
FactorA:FactorB + FactorB:FactorB:Continuous IV 1:Continuous IV 2 + (1 + FactorA|Participant)

Factor A and Factor B have two levels each and are contrast coded using the contr.sum() function.

When I call the summary of the model, it returns this:

summary(model1)
Fixed Effect                                                 B              SE       t  ....                                       
FactorA1
FactorB1                                                  (Imagine values are reported here as usual)
Cont. IV1
Cont. IV2
FactorA1:FactorB1
FactorAlevel1:FactorBlevel1:Cont. IV 1:Cont. IV2
FactorAlevel1:FactorBlevel2:Cont. IV 1:Cont. IV2
FactorAlevel2:FactorBlevel1:Cont. IV 1:Cont. IV2
FactorAlevel2:FactorBlevel2:Cont. IV 1:Cont. IV2

When I run the full-factorial model, it returns the output not split by levels of the factors, similar to the ANOVA table:

Full_Factorial = lmer(DV ~ FactorA * FactorB * Continuous IV 1 * Continuous IV 2 +
 (1 + FactorA|Participant)
summary(Full_Factorial)
Fixed Effect                                                 B              SE       t  ....                                       
FactorA1
FactorB1                                                  (Imagine values are reported here as usual)
Cont. IV1
Cont. IV2
FactorA1:FactorB1
Cont. IV1:FactorA1
.....
FactorA1:FactorB1:Cont. IV 1:Cont. IV2

My question is this: Why in the full-factorial model is the output allowed to determine the effect of the factors within their contrast-coded format, but in the model where I specify specific terms it gives me separate values for each of the factor levels in the higher-order interactions with continuous IVs? Is there a way to force B/SE/t values across levels of the factors for the higher-order interactions for a model like model 1?

This would not be a huge issue for me if I was not worried about reporting semipartial R2 for the effect of FactorA:FactorB:Cont. IV1:Cont. IV2; I realize generating the ANOVA table using anova(model1) would give me what I'm after for the output itself, but using the r2beta function in the r2glmm package to determine the semipartial R2's also breaks up the factor levels in model 1. If it is not possible to force the summary() function to report the fixed effects in the way I want, does anyone know of a way to generate semipartial R2 for the effects in model1 collapsed across factor levels as in the ANOVA table?

0

There are 0 answers