mimacro2.23 problem

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software 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!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
arthur11
Posts: 6
Joined: Wed Aug 14, 2013 2:41 pm

mimacro2.23 problem

Post by arthur11 »

Hello,
I am trying to perform multilevel multiple imputation on a simulated stata dataset via the mimacro2.23.
When I run the mi macro, I always get the error message:
"mcmc 0 b28 0 0 0 0 1 1 1 1 1 4
MCMC Error 0315: Prior variance matrix is not positive definite"
I tried to change the variances in c1096 to 0 or 0.001 as it was recommended in similar topics, but it still doesn't work out.
I can't figure out why, as when I perform the imputation with realcom everything seems to go well...
Do you have any idea? I send you attached my dataset in case you want to have a look at it.

Thanks in advance for your answer.

Regards
Attachments
realcom_dataset1.7z
(61.1 KiB) Downloaded 454 times
ChrisCharlton
Posts: 1360
Joined: Mon Oct 19, 2009 10:34 am

Re: mimacro2.23 problem

Post by ChrisCharlton »

I think that you're on the right track, although you're likely to have more success setting the covariances to zero or 0.001, rather than the variances. If you have access to software with a matrix language (e.g. Stata, R, Matlab) then you can check that the matrix that you are using is valid by using the Cholesky function on it. If this works without any errors then the matrix should be positive-definite and usable as the prior in MCMC.
arthur11
Posts: 6
Joined: Wed Aug 14, 2013 2:41 pm

Re: mimacro2.23 problem

Post by arthur11 »

Thank you for your last answer, it finally worked!
But when I try to change the imputation model (when stopping before imputation is made) by constraining the second level covariances to 0 (clrv 2 cXXX cYYY), the same error appears, even if I edit the prior covariance matrix to be positive definite.
So I wonder whether is it actually possible to set some covariances to zero in the imputation model.
Thanks in advance!
ChrisCharlton
Posts: 1360
Joined: Mon Oct 19, 2009 10:34 am

Re: mimacro2.23 problem

Post by ChrisCharlton »

When you use CLRV to remove terms from the covariance matrix these element no longer appear in c1096-c1099, i.e. if you clear the covariances only values corresponding to the variances will be in these columns. It's therefore possible that you aren't editing the elements that you think you are, although you should be able to check this by watching the values in the equation window change as you edit the values.
arthur11
Posts: 6
Joined: Wed Aug 14, 2013 2:41 pm

Re: mimacro2.23 problem

Post by arthur11 »

Thanks again.
Now I'm stumbling on another difficulty.
I am currently trying to perform an heteroscedastic imputation by setting a level 1 variance for the cluster's indicatory variables (and level 2 variance for the other covariates).
First I did it with 30 clusters, and MlwiN crashed. Perhaps because of too many parameters to estimates.
So I tried with 5 and 10 clusters: Imputation goes well, but the results of estimation are really far from what I should get, much poorer than the complete case analysis.
Any idea of the problem there?
Thank you for your valuable help.
ChrisCharlton
Posts: 1360
Joined: Mon Oct 19, 2009 10:34 am

Re: mimacro2.23 problem

Post by ChrisCharlton »

Would it be possible for you to provide more information about the model that you are trying to run and how you are setting it up?
arthur11
Posts: 6
Joined: Wed Aug 14, 2013 2:41 pm

Re: mimacro2.23 problem

Post by arthur11 »

My model is a 2 levels linear mixed effects regression with one dependant variable y and two covariates x1 and x2 with random effects, missing values MAR on x2, and indicatory variables for fixed effects of clusters.
I want to impute x2 by a linear regression on y and x1, taking into account heteroscdasticity between clusters.
In my imputation modelI set a level 1 (only) variance for indicatory variables parameters (which means a different residual term for each cluster, with separate variance), and level 2 (only) for the y and x1 parameters (and no constant).
I also clear all the covariance terms in my level 1 covariance matrix (except the diagonal terms). It makes more sense, and anyway if I don't there are too many parameters.
With a reduced number of clusters (10), results of the macro are then really far from the true analysis model (my dataset is simulated), whereas the complete case analysis was close enough.
With more clusters mlwin crashes.
I hope it is clear. Tell me if you want some precisions, or if something looks odd to you.
Thanks
ChrisCharlton
Posts: 1360
Joined: Mon Oct 19, 2009 10:34 am

Re: mimacro2.23 problem

Post by ChrisCharlton »

I have asked the authors of the multiple imputation macros to look at your questions and their response is that the macros do not support imputation models with distinct level 1 variances for each cluster. They suggest that if you have reasonably large clusters then an alternative would be to impute each cluster separately.
Post Reply