Use of predict and margins post-estimation

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
mariemurphy
Posts: 6
Joined: Sat Jan 07, 2017 7:23 pm

Use of predict and margins post-estimation

Post by mariemurphy »

Hello,

I have been attempting to obtain predictions in Stata following the fitting of my model (2 level cross-classified model using mcmc)

I found this post particularly useful in obtaining my yhat and associated standard errors:
https://www.cmm.bristol.ac.uk/forum/vie ... a2112#p452

I was hoping to calculate margins and plot the results via marginsplot as this has produced some very nice graphs for me in the past using simple linear regression. However, I get the following error after running my syntax:

predict yhatCC5
predict yhatCC5_se, stdp
gen yhatCC5_lb = yhatCC5 - 1.96 * yhatCC5_se
gen yhatCC5_ub = yhatCC5 + 1.96 * yhatCC5_se

margins, dydx(*)
Warning: cannot perform check for estimable functions.
variable var not found
r(111);

I wondered if anyone had success in using margins post estimation and might be able to advise?

Thanks in advance for your help.

Best wishes,
Marie
GeorgeLeckie
Site Admin
Posts: 432
Joined: Fri Apr 01, 2011 2:14 pm

Re: Use of predict and margins post-estimation

Post by GeorgeLeckie »

Hi Marie,

I'm afraid you will have to make your graphs from first principles. We have not done anything in runmlwin to allow margins to work with it; it is a non-trivial task.

Best wishes

George
Post Reply