[R-sig-ME] bug or numerical problem in nlme's corCAR1

Ferenci Tamas tamas.ferenci at medstat.hu
Thu Jan 25 18:05:02 CET 2018


Dear list members,

Consider the following example (yes, I haven't centered age, corCAR1
is not necessarily needed here etc., so it is perhaps not the most
meaningful model, I use it just to show the problem):

lme(distance ~ age + factor(Sex),random = ~ 1 | Subject,
   cor=corCAR1(form=~age|Subject),data = Orthodont)

Everything works perfectly.

Let's now multiply age, say, we measure it in months:

Orthodont$agemos <- Orthodont$age*12
lme(distance ~ agemos + factor(Sex),random = ~ 1 | Subject,
    cor=corCAR1(form=~agemos|Subject),data = Orthodont)

It shouldn't make any difference, but check the autocorrelation
coefficient! It changed from 0.2418536 to 0.2... i.e. it stuck at its
default value, as if it was not optimized at all! (One can verify that
it is indeed the case, and 0.2 was not a coincidence by calling
lme(distance ~ agemos + factor(Sex),random = ~ 1 | Subject,
cor=corCAR1(0.1234,form=~agemos|Subject),data = Orthodont) which will
return a coefficient of 0.1234 and so on.)

What's going on...?

Thank you in advance,
Tamas Ferenci



More information about the R-sig-mixed-models mailing list