Dear all, I have a question about marginsplot after bootstrapping:
Here is my two-stage model:
*** IV Model 1
capture program drop boot
program boot, rclass
***First Stage***
reg X i.IV Controls, robust
predict Residuals, resid
est store Residuals
***Second Stage***
probit Y c.X##c.X c.Residuals##c.Residuals Controls
margins, at(X=(0(1)48)) post
est store margins3
drop Residuals
end
bootstrap _b, reps(3) seed(123): boot
Then, I use the following command to plot margins:
est restore margins3
margins
marginsplot
I can see margins and their confidence intervals, but I am getting the following error: "variable Residuals not found" Margins and their confidence interval are already calculated, why does marginsplot command need Residuals? Is there any other command to plot already calculated margins and their confidence intervals?
Thank you very much!
Here is my two-stage model:
*** IV Model 1
capture program drop boot
program boot, rclass
***First Stage***
reg X i.IV Controls, robust
predict Residuals, resid
est store Residuals
***Second Stage***
probit Y c.X##c.X c.Residuals##c.Residuals Controls
margins, at(X=(0(1)48)) post
est store margins3
drop Residuals
end
bootstrap _b, reps(3) seed(123): boot
Then, I use the following command to plot margins:
est restore margins3
margins
marginsplot
I can see margins and their confidence intervals, but I am getting the following error: "variable Residuals not found" Margins and their confidence interval are already calculated, why does marginsplot command need Residuals? Is there any other command to plot already calculated margins and their confidence intervals?
Thank you very much!
Comment