GAMLj-main effects weird post-hoc results

Everything related to the development of modules in jamovi

by tutkuoztel » Fri Nov 15, 2019 6:00 pm


I am running a linear mixed effects analysis using GAMLJ package on jamovi. I have a model like below:

confidence ~ speed + probe duration + speed*probe duration + (1|ID)

speed is coded as ordinal variable. it has three levels, slow, medium and fast. confidence (DV) is also ordinal, 1, 2 and 3.

the main effect of speed is significant. When I look at estimates table for post-hoc results, I see that slow-medium is negative. This is weird though, the mean value for slow speed is actually LARGER than medium (I checked from descriptives. Also, thats what it seems like in the plots too). I tried to change the variable type to nominal, nothing has changed.

I also tried discarding the interaction term from my model. There, things seemed normal (slow-medium difference was positive, which sounds much more rational).

What can be the cause of this discrepancy? Or is it really a discrepancy or is there something that I miss, and everything is actually fine? :)

a quick PS: I use a filter to divide my data. i.e., I have another variable called "response" with two levels, and I use a filtering like (if "response==1") to play with data that I am particularly interested in.

thanks in advance, tutku
jamovi_weirdness.png (78.25 KiB) Viewed 1111 times
Posts: 10
Joined: Mon Apr 22, 2019 11:57 am

by » Mon Nov 18, 2019 9:58 am

HI Tuku
how did you set the "factor coding"?
User avatar
Posts: 206
Joined: Thu Mar 23, 2017 9:24 pm

by » Mon Nov 18, 2019 4:27 pm

Judging from your plot, you set probe duration as a "covariate", meaning a continuous variable and set the "Covariates Scaling" as none, which means that the IV is not centered to the mean. If this is the case, in the presence of an interaction, the effect estimates ( "slow-medium" and "medium-fast") are estimated for the other independent variable equal to zero (this is not GAMLj, it is a statistical property of the linear model). Thus, the value -0.0415 is the expected difference between slow and medium for "probe duration"=0. If you look at your plot, and project the blu and gray line back one unit on the left, you can foresee that medium becomes higher than slow. This is the interpretation of your results.

Nonetheless, I would suggest to center the covariate ("Covariates Scaling" options), so you will see that the estimates will change and would make more sense: the "slow-medium" will still be computed for IV=0, but centering makes IV=0 be equivalent to IV=mean, in our case somewhere around 2. You will see that "slow-medium" estimate becomes positive.

Centering the covariate allows us interpreting the main effects as "average effects", which is what one usually wants to estimate. That is also what you get in ANOVA-like models, and it's the suggestion several authors give to make the results clearer.
User avatar
Posts: 206
Joined: Thu Mar 23, 2017 9:24 pm

Return to Module development