【问题标题】:Marginsplot how to remove certain data from graphMarginsplot 如何从图中删除某些数据
【发布时间】:2021-11-04 15:16:17
【问题描述】:

我在 Stata 中有一个边距图,上面的线条太多,无法很好地阅读图表。我想删除不是我的情节重点的数据。

例如,我的输出是这个marginsplot,有五行,每行代表一个种族:

但是,我只想显示两条线,代表两个种族群体(URM 和白人,国内)

现在我的代码是:

reg y x##i.race $controls
margins x, by (race)
marginsplot

【问题讨论】:

  • 提供示例数据可以改善这个问题,但我在下面提供了一个示例

标签: graph stata


【解决方案1】:

您可以通过选择您计算利润的比赛来做到这一点:

webuse nhanes2, clear
local cntrls "finalwgt iron"
reg bpsystol sex#race `cntrls'
margins sex if inlist(race,1,2)==1, by (race)
marginsplot 

coefplotdrop() 选项可以提供一个替代方案。注意:coefplot 来自 SSC:ssc install coefplot

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2020-10-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-08-05
相关资源
最近更新 更多