Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Test the difference of coefficients?


    Hi guys,
    I need to examine the impacts of X on Raw Return and Alpha in two sub groups : outflow and inflow.
    However, I do not know how test on whether the difference of coefficient is significant.
    Could guys please let me know how to test the difference of coefficients by Stata?
    Thank you so much in advance!

    P.s: This is my table:
    Dep.Var= Raw Return Alpha
    Outflow Inflow Outflow Inflow
    (1) (2) (3) (4)
    Varibale X -0.094*** 0.004 -0.056*** -0.031
    (-4.96) (0.10) (-3.50) (-1.10)

  • #2
    Hoa:
    you can use -test- and/or -lincom-, as reported in the following toy-example:
    Code:
    use "C:\Program Files\Stata17\ado\base\a\auto.dta"
    . regress price mpg i.foreign
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(2, 71)        =     14.07
           Model |   180261702         2  90130850.8   Prob > F        =    0.0000
        Residual |   454803695        71  6405685.84   R-squared       =    0.2838
    -------------+----------------------------------   Adj R-squared   =    0.2637
           Total |   635065396        73  8699525.97   Root MSE        =    2530.9
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             mpg |  -294.1955   55.69172    -5.28   0.000    -405.2417   -183.1494
                 |
         foreign |
        Foreign  |   1767.292    700.158     2.52   0.014     371.2169    3163.368
           _cons |   11905.42   1158.634    10.28   0.000     9595.164    14215.67
    ------------------------------------------------------------------------------
    
    . test 0b.foreign=1.foreign
    
     ( 1)  0b.foreign - 1.foreign = 0
    
           F(  1,    71) =    6.37
                Prob > F =    0.0138
    
    . lincom 0b.foreign - 1.foreign
    
     ( 1)  0b.foreign - 1.foreign = 0
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             (1) |  -1767.292    700.158    -2.52   0.014    -3163.368   -371.2169
    ------------------------------------------------------------------------------
    
    . lincom (_cons + mpg + 0b.foreign) - (_cons + mpg + 1.foreign)
    
     ( 1)  0b.foreign - 1.foreign = 0
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             (1) |  -1767.292    700.158    -2.52   0.014    -3163.368   -371.2169
    ------------------------------------------------------------------------------
    .
    As expected, the second to last and the last -lincom- code gives back the very same results, since two out of three terms between brackest cancel each other out..
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo,
      Yes, I got it.
      Thank you so much!

      Hoa,

      Comment

      Working...
      X