Page 1 of 1
How to fit a regression model
Posted: Wed Aug 07, 2024 9:14 am
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.
Re: How to fit a regression model
Posted: Wed Aug 07, 2024 12:55 pm
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.
Re: How to fit a regression model
Posted: Wed Sep 11, 2024 10:02 am
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.