1

私はstata viaで回帰を行い、reg y xこの結果を得ました。

      Source |       SS       df       MS              Number of obs =      10
-------------+------------------------------           F(  1,     8) =   19.35
       Model |  .158119449     1  .158119449           Prob > F      =  0.0023
    Residual |  .065358209     8  .008169776           R-squared     =  0.7075
-------------+------------------------------           Adj R-squared =  0.6710
       Total |  .223477658     9  .024830851           Root MSE      =  .09039

------------------------------------------------------------------------------
           y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           x |   .4183884   .0951025     4.40   0.002     .1990816    .6376952
       _cons |     3.2228   .2231597    14.44   0.000     2.708193    3.737407
------------------------------------------------------------------------------

SS、df、MS、_con などの多くの略語が何を意味するのかわかりません。これらの略語のキーはどこにありますか? help reg私は無駄にしようとした。もともと、回帰直線の y 切片と傾きを取得したかっただけです。

4

1 に答える 1

2

help regressまず、入力してタイトルの下に表示する必要があります保存された結果. 以下のように表示されます。

regress saves the following in e():

Scalars        
  e(N)                number of observations
  e(mss)              model sum of squares
  e(df_m)             model degrees of freedom
  e(rss)              residual sum of squares
  e(df_r)             residual degrees of freedom

...

ここで、1 つまたは 2 つの数量のみに関心がある場合はereturn list、モデルの実行後に次のように入力し、必要な要素を抽出します。

例:

. sysuse auto
(1978 Automobile Data)


. reg mpg price length

      Source |       SS       df       MS              Number of obs =      74
-------------+------------------------------           F(  2,    71) =   66.65
       Model |   1594.2534     2  797.126698           Prob > F      =  0.0000
    Residual |  849.206062    71  11.9606488           R-squared     =  0.6525
-------------+------------------------------           Adj R-squared =  0.6427
       Total |  2443.45946    73  33.4720474           Root MSE      =  3.4584

------------------------------------------------------------------------------
         mpg |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       price |  -.0003013   .0001522    -1.98   0.052    -.0006047    2.10e-06
      length |  -.1895347    .020155    -9.40   0.000    -.2297226   -.1493468
       _cons |   58.77451   3.509998    16.74   0.000     51.77577    65.77325
------------------------------------------------------------------------------

. ereturn list

scalars:
                  e(N) =  74
               e(df_m) =  2
               e(df_r) =  71
                  e(F) =  66.64577432164889
                 e(r2) =  .6524574781898139
               e(rmse) =  3.458417089846885
                e(mss) =  1594.253396977965
                e(rss) =  849.2060624814947
               e(r2_a) =  .6426675479979778
                 e(ll) =  -195.2902121561856
               e(ll_0) =  -234.3943376482347
               e(rank) =  3

macros:
            e(cmdline) : "regress mpg price length"
              e(title) : "Linear regression"
          e(marginsok) : "XB default"
                e(vce) : "ols"
             e(depvar) : "mpg"
                e(cmd) : "regress"
         e(properties) : "b V"
            e(predict) : "regres_p"
              e(model) : "ols"
          e(estat_cmd) : "regress_estat"

matrices:
                  e(b) :  1 x 3
                  e(V) :  3 x 3

functions:
             e(sample)  

あなたは定数と勾配が欲しいと言った。次に、 Stata で Mata を使用できます。

 matrix list e(b)

e(b)[1,3]
         price      length       _cons
y1  -.00030128  -.18953472   58.774508
于 2013-09-11T12:33:25.907 に答える