Dear runmlwin users,
I am trying to run a multiple membership model using runmlwin. My data are hospital discharges and are structured as patients, who can be treated by multiple consultants, clustered within hospitals. When I run a null model (even just with patients as multiple members of consultants and ignoring the hospital level), I get the following error message:
MCMC Error: Residual S.E. column is too short or contains missing values.
I would appreciate any help on what this message could mean and also how to resolve this problem.
Many thanks,
Jacqueline
MCMC Error with multiple membership models
-
- Posts: 10
- Joined: Wed Nov 23, 2011 3:33 pm
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: MCMC Error with multiple membership models
Hi Jacqueline,
Good to hear from you and that you are pursuing multiple membership models with your data.
You are using MCMC to fit your model which is indeed the recommended approach in MLwiN when fitting models with cross-classified and multiple membership data structures.
First of all check that you are using the latest version of runmlwin
and MLwiN (2.24) as some fixes have been made to the way MLwiN fits non-hierarchical models using MCMC in recent months.
In order to fit these models you need to provide starting values for the MCMC chains.
One potential cause of this MLwiN error message is if you have given non-sensical starting values to the model parameters. In particular to the variance components.
The way users tend to do specify starting values in MLwiN is to first fit the nearest equivilent model using IGLS (which gives ML estimates).
If we take the simpler of your two models - patients (level 1) as multiple members of consultants (level 2) - the nearest equivalant model available under IGLS would be a standard two-level model where we treat patients (level 1) as nested within just one consultant each (level 2). So for each patient you need to pick one consultant (e.g. their final consultant) at the IGLS stage.
Have you done the above and do the IGLS parameter estimates (i.e. your MCMC starting values) look sensible? In particular make sure that the estimates of the random part parameters (your level-1 and level-2 variances) are positive and of a sensible order of magnitude.
If your error message persists, then please paste in the runmlwin commands and runmlwin output for the IGLS and MCMC versions of your model. This will give us a little more information with which to work.
I am currently writing training materials on cross-classified and multiple membership models using MLwiN, Stata and the R statistical software and I hope for these to be available through our online multilevel modelling course early in the new year.
http://www.bristol.ac.uk/cmm/learning/course.html
Best wishes
George
Good to hear from you and that you are pursuing multiple membership models with your data.
You are using MCMC to fit your model which is indeed the recommended approach in MLwiN when fitting models with cross-classified and multiple membership data structures.
First of all check that you are using the latest version of runmlwin
Code: Select all
ssc install runmlwin, replace
In order to fit these models you need to provide starting values for the MCMC chains.
One potential cause of this MLwiN error message is if you have given non-sensical starting values to the model parameters. In particular to the variance components.
The way users tend to do specify starting values in MLwiN is to first fit the nearest equivilent model using IGLS (which gives ML estimates).
If we take the simpler of your two models - patients (level 1) as multiple members of consultants (level 2) - the nearest equivalant model available under IGLS would be a standard two-level model where we treat patients (level 1) as nested within just one consultant each (level 2). So for each patient you need to pick one consultant (e.g. their final consultant) at the IGLS stage.
Have you done the above and do the IGLS parameter estimates (i.e. your MCMC starting values) look sensible? In particular make sure that the estimates of the random part parameters (your level-1 and level-2 variances) are positive and of a sensible order of magnitude.
If your error message persists, then please paste in the runmlwin commands and runmlwin output for the IGLS and MCMC versions of your model. This will give us a little more information with which to work.
I am currently writing training materials on cross-classified and multiple membership models using MLwiN, Stata and the R statistical software and I hope for these to be available through our online multilevel modelling course early in the new year.
http://www.bristol.ac.uk/cmm/learning/course.html
Best wishes
George
-
- Posts: 10
- Joined: Wed Nov 23, 2011 3:33 pm
Re: MCMC Error with multiple membership models
Hi George,
Thank you very much for your response. I will work through your suggestions and let you know how I get on.
Many thanks,
Jacqueline
Thank you very much for your response. I will work through your suggestions and let you know how I get on.
Many thanks,
Jacqueline
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: MCMC Error with multiple membership models
Hi Jacqueline,
Having thought about it a bit more, we think that it is likely that updating to the latest versions of runmlwin and MLwiN may well resolve the problem
George
Having thought about it a bit more, we think that it is likely that updating to the latest versions of runmlwin and MLwiN may well resolve the problem
George
-
- Posts: 10
- Joined: Wed Nov 23, 2011 3:33 pm
Re: MCMC Error with multiple membership models
Hi George,
You were absolutely correct - the models have been running fine since I updated the version of runmlwin. Thank you for your advice!
Just one other question - for some of the MCMC models (usually the more complex ones), I receive a message in MLWiN that 'Matrix must be positive definite for inversion'. I was wondering whether this could have something to do with the starting values?
I'm really looking forward to your training materials on cross-classified and multiple membership models!
Best wishes for the festive season,
Jacqueline
You were absolutely correct - the models have been running fine since I updated the version of runmlwin. Thank you for your advice!
Just one other question - for some of the MCMC models (usually the more complex ones), I receive a message in MLWiN that 'Matrix must be positive definite for inversion'. I was wondering whether this could have something to do with the starting values?
I'm really looking forward to your training materials on cross-classified and multiple membership models!
Best wishes for the festive season,
Jacqueline
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: MCMC Error with multiple membership models
Hi Jacqueline,
Glad that the update has solved the problem
In terms of the "Matrix must be positive definite for inversion" error message when attempting to fit models using MCMC
Yes you typuically get this error message when specifying dodgy starting values for random part covariance matrices.
You need to check that the covariance parameters that you are specifying lead to correlations which lie between -1 an 1.
You may well want to start by specifying 0 starting values for all covariance parameters.
As an aside you also need to check that you specify positive starting values for all variance parameters.
To get sensible starting values fit the nearest equivilent models in IGLS. For you this will probablu be a two-level patients-within-consultants model (i.e. where you naively assign patients to the consultant with whom they spent the most time).
I am working on the training materials on cross-classified and multiple membership models as we speak!
Best wishes
George
Glad that the update has solved the problem
In terms of the "Matrix must be positive definite for inversion" error message when attempting to fit models using MCMC
Yes you typuically get this error message when specifying dodgy starting values for random part covariance matrices.
You need to check that the covariance parameters that you are specifying lead to correlations which lie between -1 an 1.
You may well want to start by specifying 0 starting values for all covariance parameters.
As an aside you also need to check that you specify positive starting values for all variance parameters.
To get sensible starting values fit the nearest equivilent models in IGLS. For you this will probablu be a two-level patients-within-consultants model (i.e. where you naively assign patients to the consultant with whom they spent the most time).
I am working on the training materials on cross-classified and multiple membership models as we speak!
Best wishes
George
-
- Posts: 10
- Joined: Wed Nov 23, 2011 3:33 pm
Re: MCMC Error with multiple membership models
Hi George,
Thank you for your response. I will try changing the starting values as you suggest.
Kind regards,
Jacqueline
Thank you for your response. I will try changing the starting values as you suggest.
Kind regards,
Jacqueline