Hi.

The differences in contrast analysis between R and jamovi gamlj are due to the way categorical variables are coded. Please keep in mind that when you have interactions in a linear model, the linear effect of each variable is computed for the other variable equal to zero. Recall also that in R, if a character variable is not coded by the user, using `contrasts()` or similar functions, it gets coded automatically by lmer() using the function `factor()`.

Now, you have two categorical variables, one coded by you with the function `ordered()` and the other as character variable. When you use it in lmer(), it gets factored automatically and thus the resulting contrast codes are

- Code: Select all
`x<-factor(Groupe)`

contrasts(x)

C E

A 0 0

C 1 0

E 0 1

This means that the linear and quadratic effects of the variable`visite` are computed for the group Groupe=A. If you want to obtain the same results in jamovi, you should set the factor coding to "dummy" in gamlj.

Let's see now what are the results you obtained in jamovi. Gamlj produces the "main effects", meaning that the linear and quadratic effects are estimated "on average". This is because you set the coding of "Groupe" to "simple". Simple is a very smart contrast coding: it compares the reference group to each of the other groups, but it centers the contrast to 0 (the average of the sample), thus the other variables effects are computed on average. The coding scheme

2 3

A -0.3333333 -0.3333333

C 0.6666667 -0.3333333

E -0.3333333 0.6666667

and can be obtained in R with

- Code: Select all
`k<-3 #number of levels`

contrasts(x)<-contr.treatment(k)-(1/k)

If you try in R to code `Groupie` like that, you get the same results as in jamovi. More on contrasts here

https://mcfanda.github.io/gamlj_docs/rosetta_contrasts.html