Skip to content
Prev 16428 / 20628 Next

High correlation among random effects for longitudinal model

Dear Joshua,

I'm chiming in late, so it's possible that someone already pointed this out and I didn't notice. A better way to specify a polynomial in R is to use poly() in the model formula. By default, this produces orthogonal polynomial regressors (at least in the fixed effects) but the same fit to the data. For example,
1          2
[1,] -0.6324555  0.5345225
[2,] -0.3162278 -0.2672612
[3,]  0.0000000 -0.5345225
[4,]  0.3162278 -0.2672612
[5,]  0.6324555  0.5345225
attr(,"coefs")
attr(,"coefs")$alpha
[1] 3 3

attr(,"coefs")$norm2
[1]  1  5 10 14

attr(,"degree")
[1] 1 2
attr(,"class")
[1] "poly"   "matrix"
1            2 
0.000000e+00 1.110223e-16
1             2
1  1.000000e+00 -1.110223e-16
2 -1.110223e-16  1.000000e+00

My guess is that this will also reduce the correlations among the random effects. If you really must have raw polynomials, then poly(time, 2, raw=TRUE) offers the advantage that model-structure-aware functions can understand that the linear and quadratic regressors are part of the same term in the model.

Whether high correlations among the random effects are really a problem, my guess is that they aren't, because lme() uses a log-Cholesky factorization of the random-effects covariance matrix anyway. In some contexts, high correlations might produce numerical instability, but, as I said, probably not here. Ben would know.

I hope this helps,
 John

-----------------------------
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
Web: socialsciences.mcmaster.ca/jfox/
Message-ID: <ACD1644AA6C67E4FBD0C350625508EC8367CF56A@FHSDB2D11-2.csu.mcmaster.ca>
In-Reply-To: <4484_1522775758_w33HFvIo009852_CANYHYTSr3cAMZW3xu4pOCJ99k1xQEvQprFiPNKa+jHdbaDMoDw@mail.gmail.com>