Announcement

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

  • GMM: Calculating Hansen J statistic and p-value by hand

    Hello,
    I am running a two-step dynamic difference GMM with a pilot Stata command. This command calculate estimates and standard errors but does not calculate the Hansen j test of overidentifying restrictions. The pilot command builds on xtabond2 in terms of syntax. I am estimating something like this:

    Code:
     newabond y l.y l.x l.k yeardum*, gmm(y k x, lag(2 6) collapse) iv(yeardum*) noleveleq small two noconstant
    I am not a statistician, nor an expert of any kind, I am trying to compute the Hansen j test of overidentifying restrictions by hand, to see whether my instruments are endogenous. Unfortunately, the
    Code:
    estat overid
    does not work on this command.

    I have access to the original data and the following information, do you believe it is possible to calculate the Hansen j statistic and p-value with this information?

    HTML Code:
    Scalars
    
          e(N)                 Number of complete observations in untransformed data (system GMM) or transformed data (difference GMM)
          e(N_g)               Number of included individuals
          e(g_min)             Lowest number of observations in an included individual
          e(g_max)             Highest number of observations in an included individual
          e(g_avg)             Average number of observations per included individual
     
          e(iterations)        Number of iterations after iterated GMM estimation
     
          e(chi2)              Wald statistic (if small not specified)
     
          e(chi2p)             p-value of Wald statistic (if small not specified)
     
          e(F)                 F-statistic
     
          e(Fp)                p-value of F-statistic
     
       Macros
          e(ivinstsi)          Variables listed in ivstyle group i
     
          e(gmminstsi)         Variables listed in gmmstyle group
     
          e(tvar)              Time variable
     
          e(ivar)              Individual (panel) variable
     
          e(depvar)            Dependent variable
          e(xvars)             List of regressors
     
          e(properties)        "system" or "difference"
          e(small)             "small" for small
    
    Matrices
          e(b)                 Coefficient vector
          e(V)                 Variance-covariance matrix of the estimators

    If anyone could tell me the steps I need in order to calculate the Hansen j I would be extremely grateful.

    I thank you a lot in advance for your help










  • #2
    Alessandro:
    have you already taken a look at the community-contributed programme -xtoverid-?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Dear Carlo, thank you very much for your reply, I have tried to use xtoverid but it appears to work only after xtreg, xtivreg, xtivreg2 or xthtaylor.
      do you have any suggestions on how I could use xtoverid in my case?









      Comment


      • #4
        Alessandro:
        maybe this old Stata thread can be helpful: https://www.stata.com/statalist/arch.../msg00765.html
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X