How to fit a regression model

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
OscarFranco
Posts: 2
Joined: Wed Aug 07, 2024 9:00 am

How to fit a regression model

Post by OscarFranco »

I'm trying to fit a multilevel logistic regression model using the runmlwin package in Stata, and I'm encountering some issues with the estimated random effects. The model is taking a long time to converge, and I'm seeing some random effect variances that are very close to zero.

I know that in the MLwiN software directly, there is an option to set a minimum value for the random effect variances using the MISR command. Is there a similar setting or option available when running the model through runmlwin? I want to make sure I'm specifying appropriate constraints on the random effects to ensure the model converges properly and provides reliable estimates.
ChrisCharlton
Posts: 1384
Joined: Mon Oct 19, 2009 10:34 am

Re: How to fit a regression model

Post by ChrisCharlton »

The MISR command is used in conjunction with post-estimation calculation of the residuals and are not normally used in model estimation except with PQL1 or PQL2, or in MCMC where they are used for starting values. The runmlwin equivalent of this setting for post-estimation residuals is the norecode option within residuals(). This is always turned on when calculating the starting residuals for MCMC and there is not currently a way to set this for the residuals calculated within PQL1/PQL2.

If you want to exclude a random parameter (i.e. force it to zero) you can do with with the elements() option. You can find an example of this in the replication script for chapter 7 of the MLwiN user guide.

If you want to constrain parameters to take a particular value, or to be equal to each other you can do with via the standard Stata constraint command, in combination with the constraints() runmlwin option. You can find an example of the in the replication script for chapter 18 of the MLwiN user guide.
OscarFranco
Posts: 2
Joined: Wed Aug 07, 2024 9:00 am

Re: How to fit a regression model

Post by OscarFranco »

ChrisCharlton wrote: Wed Aug 07, 2024 12:55 pm The MISR command is used in conjunction with post-estimation calculation of the residuals and are not normally used in model estimation except with PQL1 or PQL2, or in MCMC where they are used for starting values. The runmlwin equivalent of this setting for post-estimation residuals is the norecode option within residuals(). This is always turned on when calculating the starting residuals for MCMC and there is not currently a way to set this for the residuals calculated within PQL1/PQL2.

If you want to exclude a random parameter (i.e. force it to zero) you can do with with the elements() option. You can find an example of this in the replication script for chapter 7tunnel rush of the MLwiN user guide.

If you want to constrain parameters to take a particular value, or to be equal to each other you can do with via the standard Stata constraint command, in combination with the constraints() runmlwin option. You can find an example of the in the replication script for chapter 18 of the MLwiN user guide.
Thanks so much.
Post Reply