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).
Can anyone please kindly offer some advice? Thank you!
2-level multilevel model issues
-
- Posts: 1384
- Joined: Mon Oct 19, 2009 10:34 am
Re: 2-level multilevel model issues
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
Alright! It is working now. Thank you very much!! 
