Level 2 unit problem

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin 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!

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
goldstar94
Posts: 1
Joined: Fri Apr 08, 2022 11:48 am

Level 2 unit problem

Post by goldstar94 »

Hi there,

After struggling with this problem for a couple of hours I've decided to resort to the forum. If this is an amateur question, please forgive me!

I am trying to run a 3-level (ordered categorical) model in MLWIN using data from the British Election Study. I have 'wave_num' at level 3, 'id' at level 2 (an identifier for respondents some of whom are observed in multiple waves) and 'n' at level 3 (an identifier for individual observations). Unfortunately, mlwin doesn't seem to be recognising my level 2 units properly. Although there are only 89,797 distinct ids, mlwin is seeing 1 id per observation (358,848) which is wrong for my structure, so I'm pretty sure my results are biased.

I have tried a few things already:
- Checking whether the data are sorted correctly (they do seem to be)
- Rounding id in STATA to exactly 1 before feeding it to mlwin.
- Rounding id in mlwin to integers
- Toggling categorical in mlwin
- feeding in ID as strings instead of numeric
- feeding in a subset of ID codes with the STATA 'int' format - i.e. no decimal points allowed

But none of them have resolved it.

Do you have any suggestions? I'm attaching a sample of the code I use to call runmlwin from STATA, as well as screenshots of the 'names' and 'equations' windows from the mlwin worksheet produced by this call.

Thanks in advance for your help :)
Attachments
runmlwin code.txt
(368 Bytes) Downloaded 178 times
mlwin names window.png
mlwin names window.png (194.07 KiB) Viewed 4747 times
mlwin equations window.png
mlwin equations window.png (213.98 KiB) Viewed 4747 times
ChrisCharlton
Posts: 1354
Joined: Mon Oct 19, 2009 10:34 am

Re: Level 2 unit problem

Post by ChrisCharlton »

Although you have checked the sorting, this does look like the sort of behaviour you would get if the data was not sorted by the identifiers defining the unit hierarchy. Can you confirm that the data is sorted by all of these ('n', 'wave_num' and 'wave')? You could also try recoding 'n' to go from 1..N in case the current values for this were causing a problem.
Post Reply