Page 1 of 1

Fitting multi-level models to weighted data runmlwin vs mixed

Posted: Mon Aug 26, 2024 3:18 pm
by alhumbert
I am fitting multi-level models to weighted data. Running MLwiN via Stata is no problem to handle this, though it is not currently possible to use MCMC estimation as I understand it. Usually comparing un/weighted models in IGLS and MCMC only provides very marginal differences anyway.

I have been asked to do some basic training for colleagues who do not have access to MLwiN, and therefore trying to adapt the syntax I normally use with the mixed command in Stata. However, I am not able to reproduce the results I get with runmlwin when it comes to compute the SE of my random effects.

I am using the European/Global Values Survey, the data are here: https://www.worldvaluessurvey.org/WVSEVSjoint2017.jsp

Below is an extract of the syntax that I am using, for weighted and unweighted models respectively.

Any idea why I am unable to get the same results, and what I am doing wrong?

Thank you for any help you might be able to provide.

Anne




mvdecode d059, mv(-5 -2 -1 = .) // treat missing values

recode d059 (1=4 "S agree") (2=3 "Agree") (3=2 "Disagree") (4=1 "S disagree") (else=.), gen(d059_rev)
label variable d059_rev "Do men make better political leaders than women do?"



***** Unweighted

runmlwin d059_rev ///
cons, ///
level2(cntry: cons, residuals(unw)) ///
level1(id: cons, ) ///
nopause


mixed d059_rev || cntry:, mle
predict unw_0, reffect reses(unw_0se)


***** Weighted


runmlwin d059_rev ///
cons, ///
level2(cntry: cons, residuals(u)) ///
level1(id: cons, weightvar(gwght)) ///
nopause


mixed d059_rev [fweight = gwght] || cntry:, mle
predict u_0, reffects reses (u_0se)

Re: Fitting multi-level models to weighted data runmlwin vs mixed

Posted: Mon Jan 06, 2025 1:24 pm
by ChrisCharlton
The most likely reason for this is that by default MLwiN applies an adjustment to the calculated variances to take into account sampling variability. This setting can be changed via the Model>Residuals window, or via the RTYPE command, however runmlwin does not currently have a way to set this. If you were to remove the nopause option and calculate the residual variance/SE within MLwiN with the adjustment turned off then you should find that they match the values calculated by the Stata mixed command.

Re: Fitting multi-level models to weighted data runmlwin vs mixed

Posted: Wed Feb 05, 2025 1:51 am
by florencepugh
Could the discrepancy in standard errors of the random effects between runmlwin and mixed be due to differences in how each command handles survey weights at different levels of the model?
Chill Guy Clicker

Re: Fitting multi-level models to weighted data runmlwin vs mixed

Posted: Tue Feb 11, 2025 7:52 am
by jessipinkman
Yes, the discrepancy in standard errors of the random effects between runmlwin and mixed could be due to differences in how each command handles survey weights at different levels. Different software and commands may apply weights differently to account for clustering, stratification, or unequal probabilities of selection, leading to variations in estimated standard errors.

Re: Fitting multi-level models to weighted data runmlwin vs mixed

Posted: Sat Apr 26, 2025 4:02 am
by EmmaAlva
This configuration can be modified through the Model>Residuals window or by using the RTYPE command; however, runmlwin does not currently support adjusting this setting tiny fishing