2

probit在不同的数据集上运行了五次相同的回归。

如何在同一张图上绘制每个回归的边际效应曲线,以便以简单的方式比较它们?

以下是我尝试过的代码:

probit one_y_unemp year* MR* AG* if Qualifica2 == 1
margins, dydx(year*) saving(me_intern, replace)

probit one_y_unemp year* MR* AG* if Qualifica3 == 1
margins, dydx(year*) saving(me_seniormanager, replace)

probit one_y_unemp year* MR* AG* if Qualifica4 == 1
margins, dydx(year*) saving(me_whitecollar, replace)

probit one_y_unemp year* MR* AG* if Qualifica5 == 1
margins, dydx(year*) saving(me_bluecollar, replace)

probit one_y_unemp year* MR* AG* if Qualifica6 == 1
margins, dydx(year*) saving(me_juniormanager, replace)

combomarginsplot me_intern me_seniormanager me_whitecollar me_bluecollar me_juniormanager, ///
labels("Intern" "Manager" "White Collar" "Blue Collar" "Junior Manager") xtitle("Years")

这段代码的问题是,我获得的图表不是每个专业角色都有一条曲线,并且 x 轴上有年份虚拟变量,而是每个虚拟年份有一条线。

4

1 回答 1

5

您可以改用社区贡献的命令coefplot

sysuse auto, clear
estimates clear

egen price2 = std(price)
egen rep782 = std(rep78)
replace rep782 = rep78 * -10

regress mpg i.foreign##c.price2 rep78
margins, dydx(foreign) at(price2=(-3(0.5)3)) post
estimates store m1

regress mpg i.foreign##c.rep782 price2
margins, dydx(foreign) at(rep782=(-3(0.5)3)) post
estimates store m2

coefplot m1 m2, at

在此处输入图像描述

于 2019-11-09T06:44:45.540 回答