Average Marginal Effects via runmlwin

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

Go to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
kofidlehman
Posts: 12
Joined: Tue Jan 07, 2014 5:28 pm

Average Marginal Effects via runmlwin

Post by kofidlehman »

Hello,
I hope you are well. I am trying compute AMEs for a multilevel multinomial logit after runmlwin and I have a couple of questions about these suggestions that Dr. Leckie provided earlier to another the forum participant in the thread below.

viewtopic.php?f=3&t=877&sid=292839f64dd ... 34bba713c4
If you are using MCMC estimation then things might actually be easier...
(1) Run the model for 1000 iterations and the save the chains as data. Or run it for 10000 iterations and set thinning to 10.
(2) Go back to the original data and expand the estimation sample by 1000 and then merge in the MCMC chains
(3) Calculate the AME in the usual way, but do it separately at each iteration of the MCMC chain
You will get 1000 values for the AME. The mean is your point estimate for the AME, the sd is your standard error.
Best wishes
George

My question is regarding the item 2) Go back to the original data and expand the estimation sample by 1000 and then merge in the MCMC chains. Does Dr. Leckie mean expand the original data set by 1000 times(each observation is multiplied by a 1000) or does he mean add a 1000 additional cases to it. Also when he says merge the mcmc chains into the original data set is he talking about about a one to one observation merge?

Another question I have is my analysis involves multilevel analysis - two levels - I assume that the earlier recommendation from Dr. Leckie to the other forum participant was for a single level multinomial logit. How would I take into account the random effect in the predictions? Thank you for any ideas you can provide.
Kofi
ChrisCharlton
Posts: 1348
Joined: Mon Oct 19, 2009 10:34 am

Re: Average Marginal Effects via runmlwin

Post by ChrisCharlton »

My interpretation of this is that he is suggesting that you duplicate each row of your dataset 1000 times (presumably with https://www.stata.com/help.cgi?expand) so that you have a copy for each MCMC iteration. You would then combine this with the parameter estimates for the corresponding iteration so that you end up with a chain of AME values, with one per iteration. You would then treat this as with any MCMC chain get summary statistics. I think that the merge is necessary as Stata only handles one dataset at a time, so both sets of values have to be combined before you can use them together in calculations.
kofidlehman
Posts: 12
Joined: Tue Jan 07, 2014 5:28 pm

Re: Average Marginal Effects via runmlwin

Post by kofidlehman »

Hi Chris,
Thank you very much for the prompt response and for the help expand link. I think I get it now. Thank you very for the help provided.
Kofi
Post Reply