0

我正在使用Stata中的几种回归(概率,logit,分位数回归,......)我想知道如何在回归者的样本均值处预测因变量。这对于 OLS 来说很简单,但看不到如何为分位数回归获取它。

4

1 回答 1

1

margins命令对此很有用:

. sysuse auto
(1978 Automobile Data)

. qreg price weight length i.foreign, nolog

Median regression                                   Number of obs =         74
  Raw sum of deviations  71102.5 (about 4934)
  Min sum of deviations 54411.29                    Pseudo R2     =     0.2347

------------------------------------------------------------------------------
       price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      weight |   3.933588   1.328718     2.96   0.004     1.283543    6.583632
      length |  -41.25191   45.46469    -0.91   0.367    -131.9284    49.42456
             |
     foreign |
    Foreign  |   3377.771   885.4198     3.81   0.000     1611.857    5143.685
       _cons |   344.6489   5182.394     0.07   0.947     -9991.31    10680.61
------------------------------------------------------------------------------

. margins, at((mean) _continuous (base) _factor)
Warning: cannot perform check for estimable functions.

Adjusted predictions                            Number of obs     =         74
Model VCE    : IID

Expression   : Linear prediction, predict()
at           : weight          =    3019.459 (mean)
               length          =    187.9324 (mean)
               foreign         =           0

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _cons |   4469.386   418.7774    10.67   0.000     3648.597    5290.175

这可以预测连续变量的协变量平均值和假人的基数的中位数(因此您可以避免无意义的值,例如部分怀孕)。

于 2018-04-18T17:19:55.427 回答