2-level multilevel model issues

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
vortexxx
Posts: 3
Joined: Thu Aug 01, 2019 2:05 pm

2-level multilevel model issues

Post by vortexxx » Thu Aug 01, 2019 3:05 pm

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 370 times
Can anyone please kindly offer some advice? Thank you!

ChrisCharlton
Posts: 1101
Joined: Mon Oct 19, 2009 10:34 am

Re: 2-level multilevel model issues

Post by ChrisCharlton » Mon Aug 05, 2019 8:37 am

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.

vortexxx
Posts: 3
Joined: Thu Aug 01, 2019 2:05 pm

Re: 2-level multilevel model issues

Post by vortexxx » Tue Aug 06, 2019 5:06 pm

Alright! It is working now. Thank you very much!! :D

Post Reply