MCMC Macro

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/
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: MCMC Macro

Post by ChrisCharlton »

If you wanted to edit the value of the first row in C1096 to be the value 1.234 then you could use the edit command as follows:

Code: Select all

NOTE put the value 1.234 into the first row of C1096
EDIT 1 C1096 1.234
If instead you wanted to enter values for a whole column at once you could use the JOIN command as follows:

Code: Select all

NOTE replace contents of C1096 with the row values 1.234 2.345 3.456 4.567
JOIN 1.234 2.345 3.456 4.567 C1096
Alternatively if you wanted to append to the column instead of replacing it with new values you might do something like:

Code: Select all

NOTE append the value 1.234 to column C1096
JOIN C1096 1.234 C1096
Regarding chain convergence, the test would be that the parameter values with different starting values have more of less the same values and standard deviations, as well as the chain being stable. If you look in the Model->trajectories window you can find the MCMC chain for each parameter, and clicking on these chains will provide additional diagnostic statistics.

What surprises me a bit about the error message that you are getting is that you only appear to have one variance at each level, so I am not sure of which matrix inversion it is referring to. Are any of the fixed parameter estimates zero for the second IGLS model, if so the problem may be there?
yongjookim78
Posts: 45
Joined: Tue Jan 10, 2017 3:36 am

Re: MCMC Macro

Post by yongjookim78 »

Thank you so much for all your helpful explanations!

Re your last point, I've got these covariates: age (continuous), education (categorical), household income (categorical), urbanicity (categorical), ...

Of these, I realized that household income only varied at the level 2 (household-level) or above and urbanicity only varied at the level 3 (neighborhood-level) or above. I just deleted those two variables and it worked well.

However, when I removed only one of them (either household income or urbanicity), the same error messages came up...

I am wondering what might be a good way that I can adjust for those household income and urbanicity in my models...

Thank you so much again!
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: MCMC Macro

Post by ChrisCharlton »

If you are getting estimates and standard errors of zero in the fixed part common causes are that some of the variables are collinear or you might have a category defined for which there is no data. I would suggest checking the correlations between your variables and also looking at the results for the IGLS model in the equations window to see which parameters are being set to zero. I would also suggest checking that the correct base category is being used for categorical variables, not having seen your data I can't tell from the macro code you provided. If these variables are added without a base category you might also see behaviour similar to yours.
Post Reply