Page 1 of 1

2-level multilevel model issues

Posted: Thu Aug 01, 2019 3:05 pm
by vortexxx
I am a beginner with MLwiN and I am using version 3.04.

In the process of solving the issues with my own data, I followed the LEMMA online course (chapter 5.1 Comparing groups using multilevel modelling). When I tried to fit a 2-level multilevel model, I got an error term saying "explanatory variables are different lengths (offset 2)"

I saw that the system generated a new variable called "cons", with n = 1. I tried to delete it but it says it is part of the model.

Also, it seems like the model was not using all cases on both levels 1 and 2 (1 of 33988 cases in use, and schoolid: 1 (of 508) in use).
question.png
question.png (17.17 KiB) Viewed 523 times
Can anyone please kindly offer some advice? Thank you!

Re: 2-level multilevel model issues

Posted: Mon Aug 05, 2019 8:37 am
by ChrisCharlton
Depending on the order in which you add variables to the model this can sometimes occur when using using simple notation (i.e. if it creates the cons column before it knows how large to make it. To fix this you just need to open the Data Manipulation->Generate Vector menu, choose cons as the output column, type in the number of records under "Number of copies", type in 1 as "Value" and finally click "Generate". If you then return to the equations window you should now see that the correct number of records is indicated.

Re: 2-level multilevel model issues

Posted: Tue Aug 06, 2019 5:06 pm
by vortexxx
Alright! It is working now. Thank you very much!! :D