【问题标题】:Estadd mean multiple regressionsEstadd 均值多元回归
【发布时间】:2014-05-16 13:33:30
【问题描述】:

我正在构建一个包含多个回归的表,并且我想添加一个 第一列,其中包含自变量的平均值。

我一直在使用 estadd mean,但它会在 each 回归之后创建一个列,而我只想在一开始就在自变量名称之后创建一个列。这是我目前使用的代码:

eststo: xtivreg2 Living_u15 Fst_gender_al ${FB} [pweight=sweight] if tag==1 & v025==2, cluster (sstate senumer) fe ivar(sstate)
 estadd mean

eststo: xtivreg2 Living_hh_u15 Fst_gender_al ${FB} [pweight=sweight] if tag==1 & v025==2, cluster (sstate senumer) fe ivar(sstate)

eststo: xtivreg2 Living_u15 Fst_gender_al ${FB} [pweight=sweight] if tag==1  & Moth_age<35 & v025==2, cluster (sstate senumer) fe ivar(sstate)
eststo: xtivreg2 Living_hh_u15 Fst_gender_al ${FB} [pweight=sweight] if tag==1  & Moth_age<35 & v025==2, cluster (sstate senumer) fe ivar(sstate)

eststo: xtivreg2 Living_u15 Fst_gender_al ${FB} [pweight=sweight] if tag==1 & Moth_age<30 & v025==2, cluster (sstate senumer) fe ivar(sstate)
eststo: xtivreg2 Living_hh_u15 Fst_gender_al ${FB} [pweight=sweight] if tag==1 & Moth_age<30 & v025==2, cluster (sstate senumer) fe ivar(sstate)


esttab using "${ndhs_table}FB_dstat.tex", cell((b mean) se) stat(N r2 F) title(..)  
addnotes(".. ") star(* 0.1 ** 0.05 *** 0.01) append

有什么办法可以解决这个问题吗?非常感谢!

【问题讨论】:

    标签: stata mean


    【解决方案1】:

    我想我会使用estposttabstat,然后在cells() 中使用&amp; 运算符来组合平均值和贝塔值。

    sysuse auto, clear
    local rhs weight trunk
    eststo clear
    eststo: estpost tabstat `rhs', stat(mean) col(stat)
    eststo: regress price `rhs'
    eststo: regress price `rhs', vce(robust)
    esttab, cells("mean & b" se) 
    

    这会产生以下结果。

    . esttab, cells("mean & b" se) nodepvar
    
    ---------------------------------------------------
                          (1)          (2)          (3)
                         est1         est2         est3
                    mean/b/se    mean/b/se    mean/b/se
    ---------------------------------------------------
    weight          3019.459      2.266182     2.266182
                                  .5110542     .6227162
    trunk           13.75676     -60.03885    -60.03885
                                  92.85726     88.23694
    _cons                         148.5533     148.5533
                                  1203.406     947.5387
    ---------------------------------------------------
    N                      74           74           74
    ---------------------------------------------------
    

    这有帮助吗?您可能仍需要进行一些修改以使标签和标题恰到好处。

    【讨论】:

      猜你喜欢
      • 2018-07-15
      • 1970-01-01
      • 2011-05-27
      • 2017-08-07
      • 2020-10-25
      • 2014-12-24
      • 2011-10-11
      • 2018-11-03
      • 1970-01-01
      相关资源
      最近更新 更多