如何在 Stata suest 后获得利润

How to get margins after suest in Stata

我是 运行 一个 sur,有两个使用 suest 的方程。如何获得 suest 之后的边距? 例如:

eststo model1: reg y1 x1##(x2 x3)
eststo model2: reg y2 x1##(x2 x3)
suest model1 model2, vce(robust)

margins, dydx(x1) predict(equation(y1)) atmeans post
margins, dydx(x1) predict(equation(y2)) atmeans post

marginssuest 之后不起作用。我使用 suest 而不是 sureg 因为我需要稳健的标准误差。

你差不多明白了,你只是把方程的名字弄错了。

suest model1 model2之后,方程将被命名为model1_meanmodel2_mean

// Get some example data
webuse regress

// Generate y2
gen y2 = y + rnormal()

// Run regressions
reg y c.x1##c.(x2 x3)
estimates store M1
reg y2 c.x1##c.(x2 x3)
estimates store M2
suest M1 M2, vce(robust)

// Get partial effects on y with respect to x1 for each model at means of x2 and x3
margins, dydx(x1) predict(equation(M1_mean)) atmeans
margins, dydx(x1) predict(equation(M2_mean)) atmeans