Covariances using orthogonal polynomials

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
kaiserdominici
Posts: 18
Joined: Thu Feb 06, 2014 9:37 am

Covariances using orthogonal polynomials

Post by kaiserdominici »

Hi all,

I am fitting a 3-level repeated measures model with random intercept and slope at levels 2 (ID) and 3 (group), with a fixed quadratic time predictor which can take 3 values corresponding to the 3 measurement occasions.

Something like:

y_ijk = B_0ijk*cons + B_1jk * Time_ijk + B_2 * Time^2_ijk
B_0ijk = B_0 + v_0k + u_0jk + e_0ijk
B_1jk = B_1 + v_1k + u_1jk

I am fitting this model in MLwiN and in R to evaluate whether there are any differences. Now, if I fit the model with the time component "as is" (i.e., the values for Time_ijk = {0,1,2} and Time^2_ijk = {0,1,4}), I have the usual collinearity issues but I get exactly the same output from both programmes (using IGLS), as should be expected.

If I use orthogonal coefficients, MLwiN and R use different contrasts, but the outcomes are comparable in everything (including -2*logLik) except for variances and covariances.

Specifically:

- The total level-2 and level-3 variances are comparable but they are decomposed differently between intercept and Time. For instance, MLwiN may return something like Var(Intercept|Group) = 35 and Var(Time|Group) = 5, whereas R Var(Intercept|Group) = 20 and Var(Time|Group) = 21. Their sum is almost identical but the decomposition differs.

- Even more puzzling, the covariances are not comparable at all. R outputs a level-2 and level-3 covariance which is identical of what both programmes find when using "standard" (i.e., non-orthogonal) coefficients, whereas MLwiN returns something completely different (in this instance, they are both rather large and negative for R and not different from 0 for MLwiN).

To summarise the covariance issue, the situation looks as follows:

Code: Select all

........................|___R___|_MLwiN_|
standard coefficients...|___-2__|___-2__|
orthogonal coefficients.|___-2__|___0.1_|
I appreciate that the two programmes use different contrasts, but I fail to see how this may affect the sign of the covariances or the decomposition of the variances.

Thank you for any thoughts,

k.
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Covariances using orthogonal polynomials

Post by ChrisCharlton »

We are not aware of any reason why this would be the case. Would it be possible to provide some example data and syntax to allow us to replicate and investigate this?
kaiserdominici
Posts: 18
Joined: Thu Feb 06, 2014 9:37 am

Re: Covariances using orthogonal polynomials

Post by kaiserdominici »

Hi Chris,

Of course, could I send you the dataset via private message? I will remove all unnecessary and personal information.

Thank you and all the best,

k.
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Covariances using orthogonal polynomials

Post by ChrisCharlton »

Could you please send it via email (my address can be found at http://www.bristol.ac.uk/cmm/team/)?
kaiserdominici
Posts: 18
Joined: Thu Feb 06, 2014 9:37 am

Re: Covariances using orthogonal polynomials

Post by kaiserdominici »

Hi Chris,

I've sent it now, the subject of the email is "covariances with orthogonal polynomials".

Thank you and apologies to the rest of the forum community for this semi-private exchange.

k.
Post Reply