Announcement

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

  • Test sum of coefficient vs lincom

    Please sympathize with me if the question below is trivial. Indeed, I have tried to search the forum but so far failed to clear my mind about that.

    My confusion is whether a test for a sum of coefficients can provide a valid conclusion as -lincom-. The below example illustrates my question.

    Code:
    sysuse auto, clear
    reg price mpg weight foreign
    
    test weight + foreign = 0
    
    lincom weight + foreign
    Your kind guidance is much appreciated.

  • #2
    lincom reports a t-statistic, whereas test reports an F-statistic. In linear regression, when testing a single coefficient, the relationship between these statistics is \(F=t^2\). Therefore, the results are indeed equivalent in this case.

    Code:
    sysuse auto, clear
    reg price mpg weight foreign
    test weight + foreign = 0
    lincom weight + foreign
    display "The t-statistic is `:di %3.2f r(t)' and F-statistic is t^2 = `:di %3.2f r(t)'^2=  `:di %3.2f `=r(t)^2' '"
    Res.:

    Code:
    . test weight + foreign = 0
    
     ( 1)  weight + foreign = 0
    
           F(  1,    70) =   28.87
                Prob > F =    0.0000
    
    .
    . lincom weight + foreign
    
     ( 1)  weight + foreign = 0
    
    ------------------------------------------------------------------------------
           price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
             (1) |   3676.525   684.2984     5.37   0.000     2311.735    5041.315
    ------------------------------------------------------------------------------
    
    .
    . display "The t-statistic is `:di %3.2f r(t)' and F-statistic is t^2 = `:di %3.2f r(t)'^2=  `:d
    > i %3.2f `=r(t)^2' '"
    The t-statistic is 5.37 and F-statistic is t^2 = 5.37^2=  28.87

    Comment


    • #3
      Andrew Musau, thank you so much for your detailed guidance.

      May I ask whether the same conclusion can always be said if we test the sum of more than two coefficients in more complicated data? I check the code below with 3 coefficients and it does show that F= t^2. However, I still wonder whether it might be different in more complicated situations.

      My ultimate concern is whether using -test- for sum coefficients always provides the same conclusion (on reject or fail to reject a null hypothesis) with -lincom-? Your kind further guidance is so much appreciated.

      Code:
      sysuse auto, clear
      reg price mpg weight foreign
      
      test mpg + weight + foreign = 0
      lincom mpg + weight + foreign
      
      display "The t-statistic is `:di %3.2f r(t)' and F-statistic is t^2 = `:di %3.2f r(t)'^2=  `:di %3.2f `=r(t)^2' '"
      Code:
      . test mpg + weight + foreign = 0
      
       ( 1)  mpg + weight + foreign = 0
      
             F(  1,    70) =   27.80
                  Prob > F =    0.0000
      
      . lincom mpg + weight + foreign
      
       ( 1)  mpg + weight + foreign = 0
      
      ------------------------------------------------------------------------------
             price | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               (1) |   3698.379   701.4449     5.27   0.000     2299.391    5097.366
      ------------------------------------------------------------------------------
      
      . display "The t-statistic is `:di %3.2f r(t)' and F-statistic is t^2 = `:di %3.2f r(t)'^2=  `:di %3.2f `=r(t)^2' '"
      The t-statistic is 5.27 and F-statistic is t^2 = 5.27^2=  27.80




      Comment


      • #4
        The test of whether the sum equals zero has one degree of freedom in the numerator, regardless of how many components constitute it, and the \(F-\)distribution simplifies to the square of the corresponding \(t-\)distribution. So yes, that will always be the case.
        Last edited by Andrew Musau; 01 May 2025, 08:00.

        Comment

        Working...
        X