Page 1 of 1

GAMLj and Linear Model inconsistency

Posted: Wed May 06, 2020 2:59 pm
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

Re: GAMLj and Linear Model inconsistency

Posted: Wed May 06, 2020 3:05 pm
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)

Re: GAMLj and Linear Model inconsistency

Posted: Wed May 06, 2020 10:20 pm
by jonathon
could it be this?

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

jonathon

Re: GAMLj and Linear Model inconsistency

Posted: Thu May 07, 2020 7:10 am
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.

Re: GAMLj and Linear Model inconsistency

Posted: Fri May 08, 2020 5:38 pm
by mcfanda@gmail.com
Could you please send the omv file so we can check out the issue? thanks

Re: GAMLj and Linear Model inconsistency

Posted: Sat May 09, 2020 5:58 pm
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

Re: GAMLj and Linear Model inconsistency

Posted: Mon May 11, 2020 6:52 am
by tutkuoztel
Thank you so much for your help! much appreciated