Open LBeaulaton opened 1 year ago
Whaouh I didn't know, seems that using ordered. You are using ordered for graphical reasons ?
Same page says : Note that when using factor by variables, centering constraints are applied to the smooths, which usually
means that the by variable should be included as a parametric term, as well.
I would follow this advice and try :
value ~ country + s(year, by=country)
Yes that was for graphical reasons. I can find a workaround (reorderng after GAM). We already center the data. I can add the parametric term, but that do not change many things.
While writing this, I had little hope it would do any good.
I propose to let this issue open to be aware of that change next year
The weird thing is that NL(at least) also changes depending on whether you use an ordered or an unordered factor while, according to the manual, it should not?
I propose to let this issue open to be aware of that change next year
We analyse time series to see any differece in trends between countries. The formula is: value ~ s(year, by=country)
However is we order the country variable it does not give the same results :
check
NO
The explanation is given here in the 'by' section. With thus conclude that
NO
has no effect while it is just because we order the factor.Changing the formula with value ~ s(year) + s(year, by=country) allow to assess an effect for![image](https://user-images.githubusercontent.com/26081069/192080076-259494cc-23d8-4015-b6d7-053bc5dac08b.png)
NO
but does not give the exact same answer :