Skip to content
Prev 15633 / 20628 Next

corAR1 question

Dear list,

After some searching  I think I know which coding of the time covariate 
corAR1 expects ... and where the strange results come from in case a 
coding system like 2, 4, 6, 8 is used.

For anyone interested, here are my findings.

The thing is that in Pinheiro and Bates, it is not very explicitly told 
(and for anywhone familiar with AR1 models, this might not be necessary 
at all...) how the time variable one uses has to coded, in case of corAR1.

Suppose we have 4 time points. Then one would normally code: 1, 2, 3, 4 
(or 1, 2, 4 if a person has a missing for the third time point). One 
could also use 10,11,12,13 as time values, this would lead to exactly 
the same results. Note that adjacent integer values must be used, no 
gaps in between are allowed.

However, with the "wave2" values 2, 4, 6, 8 for each person, there are 
no observations in the data for the intermediate timepoints 3, 5, 7! And 
this probably causes a problem and unexpected results like a different 
loglikelihood and a correlation phi1=0.

My initial idea was that with the time intervals being twice as large 
for "wave2" ("wave2" is coded as 2, 4, 6, 8, whereas  "wave" was coded 
as 1, 2, 3, 4) than for "wave", the only difference between using 
"wave2" and "wave" in

correlation=corAR1(form = ~ wave|id)

versus

correlation=corAR1(form = ~ wave|id)

would be another value for the estimated correlation phi, but that both 
specification would have the same loglikelihood and fixed effects (only 
the intercept in my example). Now this is exactly what is found when 
running:

correlation=corCAR1(form = ~ wave2|id)

With this continuous-time corCAR1 specification, the loglikelihood is 
exactly equal to the one of the corAR1(form = ~wave|id) and what is 
more: the estimated phi value equals the square root of the phi value 
corAR1(form = ~wave|id). And this makes sense! If "wave3" would be coded 
as 3, 6, 9, 12
then corCAR1(form= ~wave3|id) would again lead to the same loglikelihood 
as for corAR1(form=~wave|id) and the phi value now equals the third root 
of the phi in corAR1(form = ~wave|id).

Kind regards,

Ben.
On 3-8-2017 14:07, Ben Pelzer wrote: