Hi,
I’m using runmlwin with Stata15, and when you look at the table in Stata the random effects seem to be reporting two variances and no covariances. When I use e(RP2) I see that the covariances have been set to zero (although I think they have actually been estimated correctly, but mis-labelled). Can you help please?
Thanks!
Kate
Stata 15 runmlwin problem
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: Stata 15 runmlwin problem
Dear Kate,
You are correct. The phenomenon that you refer to relates to using runmlwin in Stata 15. Essentially random effects covariance parameters are incorrectly presented as variance parameters in the model output. The problem is brought about by a bug introduced by Stata in version 15. They are aware of the issue and it is on their to do list. The immediate workaround is just to use runmlwin within your old version of Stata 14. As we are not sure how long it will take Stata to fix their bug, we at our end are looking at any modifications we can make to runmlwin to directly to workaround this problem and will post again on this shortly. The problem is illustrated below with a two-level random-slope models of the tutorial data which comes with MLwiN.
For those knowledgeable about Stata commands. Runmlwin uses . matrix colnames to name the columns of the matrices which hold the parameter estimates and their associated statndard errors (more strictly the sampling covariance matrix associated with the parameters). In Stata 15 the . matrix colnames command now automatically renames any column with the name cov to var. Hence why the parameters in the output are being presented as variances rather than co-variances. Putting aside their reasoning for this change, the real problem is that their version control is failing for this command. Specifying . version 14 immediately before we use the . matrix colnames command does not revert it to its version 14 behaviour. This is a bug on Stata's part.
Best wishes
George
STATA VERSION 15 INCORRECT OUTPUT OF RANDOM EFFECTS PARAMETERS
STATA 14 CORRECT OUTPUT OF RANDOM EFFECTS PARAMETERS
You are correct. The phenomenon that you refer to relates to using runmlwin in Stata 15. Essentially random effects covariance parameters are incorrectly presented as variance parameters in the model output. The problem is brought about by a bug introduced by Stata in version 15. They are aware of the issue and it is on their to do list. The immediate workaround is just to use runmlwin within your old version of Stata 14. As we are not sure how long it will take Stata to fix their bug, we at our end are looking at any modifications we can make to runmlwin to directly to workaround this problem and will post again on this shortly. The problem is illustrated below with a two-level random-slope models of the tutorial data which comes with MLwiN.
For those knowledgeable about Stata commands. Runmlwin uses . matrix colnames to name the columns of the matrices which hold the parameter estimates and their associated statndard errors (more strictly the sampling covariance matrix associated with the parameters). In Stata 15 the . matrix colnames command now automatically renames any column with the name cov to var. Hence why the parameters in the output are being presented as variances rather than co-variances. Putting aside their reasoning for this change, the real problem is that their version control is failing for this command. Specifying . version 14 immediately before we use the . matrix colnames command does not revert it to its version 14 behaviour. This is a bug on Stata's part.
Best wishes
George
STATA VERSION 15 INCORRECT OUTPUT OF RANDOM EFFECTS PARAMETERS
Code: Select all
. use http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial, clear
. runmlwin normexam cons standlrt, level2 (school: cons standlrt) level1 (student: cons) nopause
MLwiN 3.1 multilevel model Number of obs = 4059
Normal response model
Estimation algorithm: IGLS
-----------------------------------------------------------
| No. of Observations per Group
Level Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
school | 65 2 62.4 198
-----------------------------------------------------------
Run time (seconds) = 1.77
Number of iterations = 4
Log likelihood = -4658.435
Deviance = 9316.87
------------------------------------------------------------------------------
normexam | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
cons | -.0115051 .039783 -0.29 0.772 -.0894783 .066468
standlrt | .5567305 .019937 27.92 0.000 .5176547 .5958062
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: school |
var(cons) | .0904446 .017924 .0553142 .1255749
var(cons) | .0180414 .0067229 .0048649 .031218
var(standlrt) | .0145361 .0044139 .0058851 .0231872
-----------------------------+------------------------------------------------
Level 1: student |
var(cons) | .5536575 .0124818 .5291937 .5781214
------------------------------------------------------------------------------
Code: Select all
. use http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial, clear
. runmlwin normexam cons standlrt, level2 (school: cons standlrt) level1 (student: cons) nopause
MLwiN 3.1 multilevel model Number of obs = 4059
Normal response model
Estimation algorithm: IGLS
-----------------------------------------------------------
| No. of Observations per Group
Level Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
school | 65 2 62.4 198
-----------------------------------------------------------
Run time (seconds) = 0.80
Number of iterations = 4
Log likelihood = -4658.435
Deviance = 9316.87
------------------------------------------------------------------------------
normexam | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
cons | -.0115051 .039783 -0.29 0.772 -.0894783 .066468
standlrt | .5567305 .019937 27.92 0.000 .5176547 .5958062
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: school |
var(cons) | .0904446 .017924 .0553142 .1255749
cov(cons,standlrt) | .0180414 .0067229 .0048649 .031218
var(standlrt) | .0145361 .0044139 .0058851 .0231872
-----------------------------+------------------------------------------------
Level 1: student |
var(cons) | .5536575 .0124818 .5291937 .5781214
------------------------------------------------------------------------------
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: Stata 15 runmlwin problem
As a follow on from our previous post, we note that an additional error arises when one specifies the correlations option. The correlations option requests the estimated school-level covariance between the random intercepts and slopes to be reexpressed as a correlation. In Stata 15 this option no longer works. Not only is the labeling incorrect, but now the presented estimate for the school-level correlation is also incorrect (var(cons) = .0180414). The presented estimate is still that of the school-level covariance.
STATA VERSION 15 INCORRECT OUTPUT OF RANDOM EFFECTS PARAMETERS
STATA 14 CORRECT OUTPUT OF RANDOM EFFECTS PARAMETERS
STATA VERSION 15 INCORRECT OUTPUT OF RANDOM EFFECTS PARAMETERS
Code: Select all
. use http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial, clear
. runmlwin normexam cons standlrt, ///
> level2 (school: cons standlrt) ///
> level1 (student: cons) ///
> correlations ///
> nopause
MLwiN 3.1 multilevel model Number of obs = 4059
Normal response model
Estimation algorithm: IGLS
-----------------------------------------------------------
| No. of Observations per Group
Level Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
school | 65 2 62.4 198
-----------------------------------------------------------
Run time (seconds) = 0.81
Number of iterations = 4
Log likelihood = -4658.435
Deviance = 9316.87
------------------------------------------------------------------------------
normexam | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
cons | -.0115051 .039783 -0.29 0.772 -.0894783 .066468
standlrt | .5567305 .019937 27.92 0.000 .5176547 .5958062
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: school |
var(cons) | .0904446 .017924 .0553142 .1255749
var(cons) | .0180414 .0067229 .0048649 .031218
var(standlrt) | .0145361 .0044139 .0058851 .0231872
-----------------------------+------------------------------------------------
Level 1: student |
var(cons) | .5536575 .0124818 .5291937 .5781214
------------------------------------------------------------------------------
STATA 14 CORRECT OUTPUT OF RANDOM EFFECTS PARAMETERS
Code: Select all
. use http://www.bristol.ac.uk/cmm/media/runmlwin/tutorial, clear
. runmlwin normexam cons standlrt, ///
> level2 (school: cons standlrt) ///
> level1 (student: cons) ///
> correlations ///
> nopause
MLwiN 3.1 multilevel model Number of obs = 4059
Normal response model
Estimation algorithm: IGLS
-----------------------------------------------------------
| No. of Observations per Group
Level Variable | Groups Minimum Average Maximum
----------------+------------------------------------------
school | 65 2 62.4 198
-----------------------------------------------------------
Run time (seconds) = 0.87
Number of iterations = 4
Log likelihood = -4658.435
Deviance = 9316.87
------------------------------------------------------------------------------
normexam | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
cons | -.0115051 .039783 -0.29 0.772 -.0894783 .066468
standlrt | .5567305 .019937 27.92 0.000 .5176547 .5958062
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
Level 2: school |
var(cons) | .0904446 .017924 .0553142 .1255749
corr(cons,standlrt) | .4975713 .1437398 .2158466 .7792961
var(standlrt) | .0145361 .0044139 .0058851 .0231872
-----------------------------+------------------------------------------------
Level 1: student |
var(cons) | .5536575 .0124818 .5291937 .5781214
------------------------------------------------------------------------------
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: Stata 15 runmlwin problem
Dear All,
The problems described in this topic have now been addressed by Stata. Please update to the latest version of Stata...
. update all
Then update to the latest version of runmlwin
. ssc install runmlwin, replace
Best wishes
George
The problems described in this topic have now been addressed by Stata. Please update to the latest version of Stata...
. update all
Then update to the latest version of runmlwin
. ssc install runmlwin, replace
Best wishes
George