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
Level 2 unit problem
-
- Posts: 1
- Joined: Fri Apr 08, 2022 11:48 am
Level 2 unit problem
- Attachments
-
- runmlwin code.txt
- (368 Bytes) Downloaded 207 times
-
- mlwin names window.png (194.07 KiB) Viewed 7813 times
-
- mlwin equations window.png (213.98 KiB) Viewed 7813 times
-
- Posts: 1360
- Joined: Mon Oct 19, 2009 10:34 am
Re: Level 2 unit problem
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.