Use of predict and margins post-estimation
Posted: Sat Jan 14, 2017 5:24 pm
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
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