Announcement

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

  • Testing multiple coefficients equal to 1 with test

    Hi all. I am running a panel regression with over 60 dummy variable coefficients that I'd like to test as being equal to 1, but jointly. Typically when testing whether or not the estimated coefficients are jointly equal to 0 (or, with the 'equal' option, equal to each other), I can just use testparm. But when I want to test whether they are equal to 1, I don't see an easy way to do this.
    I will also note that I have a subset of dummies in my regression that I want to test whether the coefficients are jointly equal to 0, while the remainder I would like to test as all being equal to 1. Should I normalize the latter subset of the coefficients in some way so that I can just use testparm?
    Thanks for any and all advice on this topic.

  • #2
    Code:
    . webuse grunfeld, clear
    
    . regress invest mvalue kstock i.company
    
          Source |       SS           df       MS      Number of obs   =       200
    -------------+----------------------------------   F(11, 188)      =    288.50
           Model |   8836465.8        11  803315.073   Prob > F        =    0.0000
        Residual |  523478.114       188  2784.45805   R-squared       =    0.9441
    -------------+----------------------------------   Adj R-squared   =    0.9408
           Total |  9359943.92       199  47034.8941   Root MSE        =    52.768
    
    ------------------------------------------------------------------------------
          invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
          mvalue |   .1101238   .0118567     9.29   0.000     .0867345    .1335131
          kstock |   .3100653   .0173545    17.87   0.000     .2758308    .3442999
                 |
         company |
              2  |   172.2025   31.16126     5.53   0.000     110.7319    233.6732
              3  |  -165.2751   31.77556    -5.20   0.000    -227.9576   -102.5927
              4  |    42.4874   43.90987     0.97   0.334    -44.13197    129.1068
              5  |  -44.32013   50.49225    -0.88   0.381    -143.9243    55.28406
              6  |   47.13539   46.81068     1.01   0.315    -45.20629    139.4771
              7  |   3.743212   50.56493     0.07   0.941    -96.00433    103.4908
              8  |   12.75103   44.05263     0.29   0.773    -74.14994      99.652
              9  |  -16.92558   48.45326    -0.35   0.727    -112.5075    78.65636
             10  |   63.72884   50.33023     1.27   0.207    -35.55572    163.0134
                 |
           _cons |  -70.29669   49.70796    -1.41   0.159    -168.3537    27.76035
    ------------------------------------------------------------------------------
    
    . test (2.company=1) (3.company=1) (4.company=1)
    
     ( 1)  2.company = 1
     ( 2)  3.company = 1
     ( 3)  4.company = 1
    
           F(  3,   188) =  136.43
                Prob > F =    0.0000

    Comment


    • #3
      Also, note that with a long list, you can use -levelsof- to store the levels of the indicator variable. Then, you don't have to write out the full syntax. In the continuous case,

      Code:
      webuse grunfeld, clear
      qui regress invest mvalue kstock i.company
      forval i= 2/10{
      local list "`list' (`i'.company=1)"
      }
      di "`list'"
      test `list'
      Result:

      Code:
      . di "`list'"
       (2.company=1) (3.company=1) (4.company=1) (5.company=1) (6.company=1) (7.company=1) (8.company=1) (9.company=1) (10.company=1)
      
      . test `list'
      
       ( 1)  2.company = 1
       ( 2)  3.company = 1
       ( 3)  4.company = 1
       ( 4)  5.company = 1
       ( 5)  6.company = 1
       ( 6)  7.company = 1
       ( 7)  8.company = 1
       ( 8)  9.company = 1
       ( 9)  10.company = 1
      
             F(  9,   188) =   49.18
                  Prob > F =    0.0000

      Comment

      Working...
      X