Page 1 of 1

Level 2 unit problem

Posted: Fri Apr 08, 2022 3:08 pm
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 :)

Re: Level 2 unit problem

Posted: Tue Apr 12, 2022 1:14 pm
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.