Hi There - I am trying to run a 5-level model in which individuals are nested in households, villages, districts, and states in India. However, when I execute my runmlwin code in Stata, it opens MLwiN and the MLwiN begins to read in all the data file observations as though I am loading a new sheet directly in to MLwiN. This does not happen when I run a 4-level model without the individuals. Any thoughts on why this might be occurring? My code is below. Thanks!
*4-LEVEL CODE (works fine)
xi: runmlwin santype1 constant,level4(hv024: constant, residuals(res_state)) level3(shdist: constant, residuals(res_dist)) level2(hv001: constant, residuals(res_clust)) ///
level1(case:, ) discrete(distribution(binomial) link(logit) denominator(constant)) mlwinsettings(optimat)nopause
xi: runmlwin santype1 constant,level4(hv024: constant, residuals(res_state1)) level3(shdist: constant, residuals(res_dist1)) level2(hv001: constant, residuals(res_clust1)) ///
level1(case:, ) discrete(distribution(binomial) link(logit) denominator(constant)) mlwinsettings(optimat) mcmc(on) initsprevious nopause
ge beta0 = _b[constant]
*5-LEVEL CODE (not working)
xi: runmlwin santype1 constant,level5(hv024: constant, residuals(res_state)) level4(NFHS5_Code: constant, residuals(res_dist)) level3(hv001: constant, residuals(res_clust)) ///
level2(case: constant, residuals(res_case)) level1(id:, ) discrete(distribution(binomial) link(logit) denominator(constant)) mlwinsettings(optimat)nopause
xi: runmlwin santype1 constant,level5(hv024: constant, residuals(res_state1)) level4(NFHS5_Code: constant, residuals(res_dist1)) level3(hv001: constant, residuals(res_clust1)) ///
level2(case: constant, residuals(res_case1)) level1(id:, ) discrete(distribution(binomial) link(logit) denominator(constant)) mlwinsettings(optimat) mcmc(on) initsprevious nopause
ge beta0 = _b[constant]
runmlwin causing MLwiN to load all observations
-
- Posts: 1371
- Joined: Mon Oct 19, 2009 10:34 am
Re: runmlwin causing MLwiN to load all observations
Would you be able to elaborate on the error that this is causing? The data should be loaded into MLwiN in both cases, however it may be that the data for the 5 level model is large enough that MLwiN has time to report the loading progress. Does the model fail to estimate, or are there problems when returning the results to Stata?
Re: runmlwin causing MLwiN to load all observations
Hi Chris,
Thanks for the note. It's the same dataset for both the 4L and 5L models. However, for the 5L model, I get the red loading numbers on the bottom left of the screen. This isn't a problem save for the fact that it is taking >20 hours to load. It's confusing because MLwiN seems to be skipping this step with the 4L models! So to be clear, no "error" message. It's just the loading step is skipped in one set of models, but included in the other.
Thanks for the note. It's the same dataset for both the 4L and 5L models. However, for the 5L model, I get the red loading numbers on the bottom left of the screen. This isn't a problem save for the fact that it is taking >20 hours to load. It's confusing because MLwiN seems to be skipping this step with the 4L models! So to be clear, no "error" message. It's just the loading step is skipped in one set of models, but included in the other.
-
- Posts: 1371
- Joined: Mon Oct 19, 2009 10:34 am
Re: runmlwin causing MLwiN to load all observations
The loading procedure should be the same for both models, I think that you just don't see the loading message on the four level model because the data finishes loading before the message is displayed. The question is therefore why the data takes so much longer to load for the five level model. My suggestion would be to look at characteristics of the variables and level identifiers that are included in the five level, but not the four level model. MLwiN stores all of its data as numeric variables so if for example the level-5 identifier was a string variable in Stata then this would have to be converted into a numeric variable with string labels when it is loaded which can take a long time.
Re: runmlwin causing MLwiN to load all observations
Hi Chris - Thanks so much for the note. You were spot on. I accidentally left the level 1 variable as a string, which caused the issue. I re-cleaned the data with that variable as a numeric and now the issue has been resolved. Thank you so much for your prompt help!