Announcement

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

  • t.-test for coefficients of the same regression

    Dear Stata Users,

    I am using the following regression:
    Code:
    reghdfe y x1 x2 x3 if inrange(fyear,2003, 2014), absorb(gvkey_destr fyear) vce(cluster gvkey_destr fyear)
    what I want is to check if x2+x3 is significantly different from zero. I used the following code:
    Code:
    test [x2 + x3]   = 0
    Is that right? The problem is that with a pooled ols I was using the following code, but “reghdfe” does not support it:
    Code:
    xi: reg y x1 x2 x3 if inrange(fyear,2003, 2014)
    estimate store c_zero_opport
    suest c_zero_opport, vce(cluster gvkey)
    test [mean]x2   +  [mean]x3   = 0

  • #2
    Code:
    test [x2 + x3] = 0
    will work. You don't actually need the square brackets there, but they don't hurt anything either.

    Note: in your original
    Code:
    xi: reg y x1 x2 x3 if inrange(fyear,2003, 2014)
    estimate store c_zero_opport
    suest c_zero_opport, vce(cluster gvkey)
    test [mean]x2 + [mean]x3 = 0
    you have made things much more complicated than is necessary. First, the -xi:- prefix does nothing there. (You probably shouldn't be using it anyway, as for almost all purposes factor-variable notation is better.) Next, there is no need to go through storing the estimates and running them through -suext-. All you needed is:

    Code:
    reg y x1 x2 x3 if inrange(fyear, 2003, 2014)
    test x2 + x3 = 0
    to do that.

    General point: -suest- is only needed to test coefficients across different regressions. For testing things about coefficients in a single equation, just go directly to -test-.

    Comment


    • #3
      Thank you very much!

      Comment

      Working...
      X