Announcement

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

  • Hausman Specification test - chi2-calculation

    Hausman specification test, "hausman", for panel data regression models FE vs RE produces a value of Chi-sq. statistic that is essentially different from that calculated directly using coefficient vectors e(b) and variance-covariance matrices e(V). (The values of chi-2 calculated directly here are the same to those calculated in R both directly and using "phtest" from "plm" ). The data are from https://research.stlouisfed.org/publ...t-cold-war-era . Stata 17 MP
    The code is:
    Code:
    xtset countryid year
    xtreg raid gdpcap gdpcap2 infmort infmort2 rights goveff popmil pop2 y2 y3, fe
    est store fem
    matrix b=e(b)
    matrix Vb=e(V)
    xtreg raid gdpcap gdpcap2 infmort infmort2 rights goveff popmil pop2 y2 y3, re
    est store rem
    matrix B=e(b)
    matrix VB=e(V)
    *** Hausman test
    hausman fem rem
    hausman fem rem, sigmaless 
    *** Manual calculations of Housman test Chi-sq
    matrix b_B= (b-B)'
    matrix Vdiff=Vb-VB
    ***constant term remove
    matrix b_B=b_B[1..10, 1]
    matrix Vdiff=Vdiff[1..10, 1..10]
    ***Chi-sq-calc
    matrix chi=b_B'*syminv(Vdiff)*b_B
    matrix list chi
    Results:
    Code:
    Test of H0: Difference in coefficients not systematic
    
       chi2(10) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                =  10.73
    Prob > chi2 = 0.3790
    
    . *** Manual calculations of Housman test Chi-sq
    . matrix b_B= (b-B)'
    . matrix Vdiff=Vb-VB
    
    . ***constant term remove
    . matrix b_B=b_B[1..10, 1]
    . matrix Vdiff=Vdiff[1..10, 1..10]
    
    . ***Chi-sq-calc
    . matrix chi=b_B'*syminv(Vdiff)*b_B
    . matrix list chi
    
    symmetric chi[1,1]
               y1
    y1  23.531672
    What might be a matter of such difference? Thanks.

  • #2
    Alex:
    welcome to this forum.
    Does the same issue creep up if you do not invoke the -sigmaless- option available from -hausman-?
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Carlo, thank you. I have been a reader for a long time.
      Yes, the issue holds. The chi2 is slightly different (smaller) without -sigmaless- . The reason for -sigmaless- was the receiving of -not positive definite- warning. As i mentioned above - R produces same result to the matrix calculations . I attached the data in Stata format for the case one may want to look at.
      Attached Files

      Comment

      Working...
      X