GAMLj and Linear Model inconsistency

Everything related to the development of modules in jamovi
Post Reply
tutkuoztel
Posts: 17
Joined: Mon Apr 22, 2019 11:57 am

GAMLj and Linear Model inconsistency

Post by tutkuoztel »

hello!

I have a question. when I run the same model using Linear Regression section and General Linear Model from GAMLj package, some of the estimates are different. how come? and why so? which one should I rely on and report?

I attach the picture of it (left side model is built in Linear Regression section and right side in General Linear Model)

Thanks in advance, tutku
Attachments
jamovi_help.png
jamovi_help.png (191.95 KiB) Viewed 5815 times
tutkuoztel
Posts: 17
Joined: Mon Apr 22, 2019 11:57 am

Re: GAMLj and Linear Model inconsistency

Post by tutkuoztel »

btw, the model that i built using the Linear Regression section is consistent with R.

as a side note: I have interaction term in my model (dont know if saying it helps solving the problem in any way, but just wanted to put it there)
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: GAMLj and Linear Model inconsistency

Post by jonathon »

could it be this?

https://forum.jamovi.org/viewtopic.php?f=6&t=1272#p4406

jonathon
tutkuoztel
Posts: 17
Joined: Mon Apr 22, 2019 11:57 am

Re: GAMLj and Linear Model inconsistency

Post by tutkuoztel »

nah, I tried to change the scaling of the variables. it didnt work at all, yielded in same results (nothing changed in the coefficients), thus the inconsistency remains.
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: GAMLj and Linear Model inconsistency

Post by mcfanda@gmail.com »

Could you please send the omv file so we can check out the issue? thanks
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: GAMLj and Linear Model inconsistency

Post by mcfanda@gmail.com »

HI
as usual with regression with interactions, the mismatching of different analyses is due to different coding of the variables. In your case, the issue is not the continuous variable (that you centered yourself so galmj, jamovi regression and R behave in the same way), but is the categorical variable (the factor centered_condition).
jamovi linear regression and default R set the reference level of the factor to one group, in your case group 0. Please notice that this does not depend on the numbers you put in the columns (i.e. -25, 0 25 is equivalent to A, B , and C, because factors are recoded internally by jamovi or R). In jamovi regression, you can go to the "Reference level" tab and change the reference group and you 'll see that the estimate of the effect of "centered_pse" will change. The same happens to in R if you do
levels(data$centered_condition)<-contr.treatment(3,base = 1)
and change base=1 to base=2 or 3. This means that the effect of "centered_pse" that you see in regression or R is the effect of centered_pse" computed for condition=0, so for that group only. It is not a main effect, it is a simple effect.

Gamlj centers the coding, so even though the comparisons made are the same as in regression and R, the coding system is centered, so you can interpret the effect of "centered_spe" as the "average effect" or the "main effect". If you want to obtain exactly the same results in gamlj and in jamovi regression, you should go to "Factor coding" in gamlj and set it to "dummy".
If you want to get in R and jamovi regression the same results than in gamlj default estimation, you need to run
levels(data$centered_condition)<-contr.treatment(3)-(1/3)
in R or set "Grand mean (simple coding)" option in jamovi regression.


Short story: All estimates are correct, they required different interpretations. R default and jamovi regression give you the simple effect of centered_pse for condition=0, gamlj gives you the main effect of it. All other coefficients are the same

Suggestion: what I guess you want to report are the main effects and interactions, so report the results of any of the following:
1) gamlj defaul
2) jamovi regression with "Grand mean (simple coding)" option on
3) R glm with levels(data$centered_condition)<-contr.treatment(3)-(1/3)

they are all equal
tutkuoztel
Posts: 17
Joined: Mon Apr 22, 2019 11:57 am

Re: GAMLj and Linear Model inconsistency

Post by tutkuoztel »

Thank you so much for your help! much appreciated
Post Reply