GAMLj and Linear Model inconsistency

Everything related to the development of modules in jamovi

by tutkuoztel » Wed May 06, 2020 2:59 pm

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 1925 times
tutkuoztel
 
Posts: 15
Joined: Mon Apr 22, 2019 11:57 am

by tutkuoztel » Wed May 06, 2020 3:05 pm

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)
tutkuoztel
 
Posts: 15
Joined: Mon Apr 22, 2019 11:57 am

by jonathon » Wed May 06, 2020 10:20 pm

could it be this?

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

jonathon
User avatar
jonathon
 
Posts: 1474
Joined: Fri Jan 27, 2017 10:04 am

by tutkuoztel » Thu May 07, 2020 7:10 am

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.
tutkuoztel
 
Posts: 15
Joined: Mon Apr 22, 2019 11:57 am

by mcfanda@gmail.com » Fri May 08, 2020 5:38 pm

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

by mcfanda@gmail.com » Sat May 09, 2020 5:58 pm

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
User avatar
mcfanda@gmail.com
 
Posts: 217
Joined: Thu Mar 23, 2017 9:24 pm

by tutkuoztel » Mon May 11, 2020 6:52 am

Thank you so much for your help! much appreciated
tutkuoztel
 
Posts: 15
Joined: Mon Apr 22, 2019 11:57 am


Return to Module development