如何在reg之后获得标准错误

时间:2017-10-15 05:00:00

标签: regression stata standard-error

我有一个与此类似的代码

sysuse auto
statsby, by(foreign rep78): regress mpg weight

运行代码后,我得到一个常量列和一个相对于权重的系数列。

如何获取标准错误的列?

1 个答案:

答案 0 :(得分:1)

必须在_se的输出中指定statsby,如下所示:

sysuse auto, clear
statsby _b _se, by(foreign rep78): regress mpg weight

list, abbreviate(10)

     +-----------------------------------------------------------------+
     |  foreign   rep78   _b_weight    _b_cons   _se_weight   _se_cons |
     |-----------------------------------------------------------------|
  1. | Domestic       1   -.0081081   46.13514            0          0 |
  2. | Domestic       2   -.0080464   46.11072     .0010219    3.45372 |
  3. | Domestic       3    -.005066   36.43828     .0007593    2.65751 |
  4. | Domestic       4   -.0050019   36.11242     .0010235   3.697895 |
  5. | Domestic       5      -.0125       56.5            0          0 |
     |-----------------------------------------------------------------|
  6. |  Foreign       3   -.0154762   54.44048     .0034366   6.921931 |
  7. |  Foreign       4   -.0055003   37.03232      .002241   4.998033 |
  8. |  Foreign       5   -.0196984   73.67505      .004578   11.14064 |
     +-----------------------------------------------------------------+