私は互いに下の2つの回帰の係数(信頼区間を持つ)を表示したいと思います。 Ben Jannの素敵なcoefplot
(ssc install coefplot
)を使用すると、すべてのモデルのすべての係数が含まれているグラフのみを1つのサブグラフで作成できますが、係数ではなくモデルで係数を並べることに成功しません。coefplot:それぞれ1つのグラフにいくつかの係数を持つ複数のモデル
また、私は必要ではない係数でいくつかの部分グラフを持つグラフを作成することができます:係数の共通のスケールと1つのサブグラフが必要です。ここで
は私のニーズと私はちょうど説明を示す最低限の例が来る:
sysuse auto.dta, clear
reg price mpg rep78
eststo model1
reg price mpg rep78 weight
eststo model2
*what do I have: 2 models with 2 coefficients each (plus constant)
*what do I want: 1 graph with 2 models beneath one another,
*2 coefficients per model, 1 colour and legend entry per coefficient (not model!)
*common scale
*what is easy to get:
coefplot model1 model2, ///1 graph with all coefficients and models,
keep(mpg rep78) //but order is by coefficient, not by model
//how to add model names as ylabels?
*or 1 graph with 2 subgraphs by coefficient:
coefplot model1 || model2, ///
keep(mpg rep78) bycoefs
誰が最適coefplot
を使用して、私がしたいグラフを得ることに私を助けることができますか?
この例の注釈を読んでもわかるように、完璧な解決策には、モデル名を使用して係数(モデルではない)とylabelごとに1つの色と凡例エントリが含まれますが、これは二次的です。
私は既にcoefplot
オプションのいくつかを試しましたが、それらのほとんどは、異なるモデルの係数ではなく、1つのモデルからいくつかの方程式用です。