graph - Marginsplot 如何从图中删除某些数据
问题描述
我在 Stata 中有一个边距图,上面的线条太多,无法很好地阅读图表。我想删除不是我的情节重点的数据。
例如,我的输出是marginsplot
五行,每行代表一个种族:
但是,我只想显示两条线,代表两个种族群体(URM 和白人,国内)
现在我的代码是:
reg y x##i.race $controls
margins x, by (race)
marginsplot
解决方案
您可以通过选择您计算利润的比赛来做到这一点:
webuse nhanes2, clear
local cntrls "finalwgt iron"
reg bpsystol sex#race `cntrls'
margins sex if inlist(race,1,2)==1, by (race)
marginsplot
coefplot
的drop()
选项可以提供一种替代方法。注:coefplot
来自 SSC ssc install coefplot
:.
推荐阅读
- jestjs - 开玩笑,使用不同的 jest.mock 进行不同的测试
- python - 如何知道python包的特性?
- c - 使用 C 检测 Linux 中拔出的电缆
- php - 无法在 Docker x Wordpress Local 上为 MacOS 10.13.6 定制任何东西
- ruby-on-rails - 如果没有传入强参数,我如何更新当前模型中的参数?
- c# - 我应该如何在 C# 中命名支持属性?
- c# - c#将double转换为字符串问题
- django - 向表单添加了更多字段,但未显示更改
- javascript - 如何根据媒体查询更新样式组件的变量?
- ios - 如何从另一个类重新加载 ViewController?