Announcement

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

  • Testing weakiv for xtabond2

    Dear all

    I am running the following command for xtabond2 which runs well:

    xtabond2 lnaq l(1/2).lnaq uer sdR da sa asset cx i.year lnage, gmm(lnaq, lag(3 5) collapse) gmm(da, lag(4 5) collapse) gmm(asset, lag(4 5) collapse) gmm(uer, lag(4 .)collapse) gmm(sa, lag(4 5) collapse) gmm(l.cx, lag(3 5)collapse) iv(i.year lnage) twostep robust small svmat h(2)

    The version of my xtabond2 is 03.06.00 which is the latest version
    Still I get the following message:

    . weakiv, small

    Error: xtabond2 saved matrix e(ideqt) not found
    Must have xtabond2 version 03.04.00 or greater installed
    To install, from within Stata type
    ssc install xtabond2
    r(111);

    Please help.

    - Kinshuk

  • #2
    Kinshuk,

    The version of xtabond2 on my machine is "xtabond2 3.6.1 5 December 2014", and weakiv definitely works with it. Can you try updating xtabond2 and see if that fixes the problem? It doesn't sound like weakiv needs updating, but you can try that too - the latest version should be 2.4.05.

    --Mark

    Comment


    • #3
      PROBLEM: Not able to get confidence interval in weakiv test for xtabond2

      Hi Mark, As suggested by you I have checked xtabond2 and weakiv versions. Both are latest. I have made some changes and now run the programs successfully. However I do not get the confidence interval for the weakiv test.

      I make the xtabond2 command crisp as following:
      xtabond2 lnaq l(1/2).lnaq uer sdR da sa asset cx i.year lnage, gmm(lnaq da sa asset cx, lag(4 5) collapse) iv(i.year lnage sdR uer, eq(level)) twostep robust small svmat

      Thereafter I run weakiv as follows:

      weakiv

      I get the results now .........as following:

      Estimation using xtabond2-transformed data:
      Number of obs: diff eqn = 2948, lev eqn = 3280, total = 6228
      Number of vars: #endog = 18, #inexog = 1, #exexog = 27
      Endog regressors: L.lnaq L2.lnaq uer sdR dta sta lnta capexta 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year lnage
      Exog regressors: _cons
      warning - must specify number of points using gridpoints(.) option
      if number of weakly endogenous is >5 and grid is required;
      grid not constructed

      Weak instrument robust tests for linear IV
      H0: beta[lnaq:L.lnaq L2.lnaq uer sdR da sa asset cx 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year lnage] = [0 0 0 0 0
      > 0 0 0 0 0 0 0 0 0 0 0 0 0]
      ----------------------------------------
      Test | Statistic p-value
      ------+---------------------------------
      CLR | stat(.) = 251.33 0.0000
      K | chi2(18) = 198.18 0.0000
      J | chi2(9) = 53.56 0.0000
      K-J | <n.a.> 0.0000
      AR | chi2(27) = 251.75 0.0000
      ------+---------------------------------
      Wald | chi2(18) = 1655.59 0.0000
      ----------------------------------------
      CLR distribution and p-values obtained by simulation (10000 draws).
      Number of obs N = 6228. Number of groups = 333; avg obs per group = 9.8.
      Method = lagrange multiplier (LM). Weight on K in K-J test = 0.800.
      Tests robust to heteroskedasticity and clustering on serial (N_clust=333). Small sample adjustments were used.
      Wald statistic in last row is based on xtabond2 estimation and is not robust to weak instruments.

      If I use following command I still do not get cofidence set. I get the error message as following

      weakiv, gridpoints(4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4)

      Estimation using xtabond2-transformed data:
      Number of obs: diff eqn = 2948, lev eqn = 3280, total = 6228
      Number of vars: #endog = 18, #inexog = 1, #exexog = 27
      Endog regressors: L.lnaq L2.lnaq uer sdR dta sta lnta capexta 2002.year 2003.year 2004.year 2005.year 2006.year 2007.year 2008.year 2009.year 2010.year lnage
      Exog regressors: _cons
      option points() incorrectly specified





      .


      Comment


      • #4
        The basic problem is that you have 18 (!) endogenous regressors in your specification. If you have 1 endogenous regressor, weakiv will construct and report a confidence interval, i.e., a 1-dimensional confidence set. The CI is reported either in a table or in a graph. If you have 2 endogenous regressors, weakiv will do a grid search to construct a 2-dimensional confidence set. This is saved in a grid and can be graphed in a 2-D contour plot. If you have K endogenous regressors, K>2, weakiv can do a grid-search to construct the K-dimensional confidence set but it has no way of reporting it (3-D graphing is sort-of-possible but beyond that, well...). So all it will report in this case is a test of the specific null hypothesis, which in your case is the default null that all 18 parameters are zero.

        If you want weakiv to report confidence sets in your application, either graphically or in a table, you need to somehow shrink the dimensionality of the problem, either by reducing the number of endogenous regressors to 1 or 2, or by reducing the number of weakly-identified endogenous regressors to 1 or 2. This means specifying either that the other 16-17 regressors are exogenous (in the xtabond2 specification) and/or that they are strongly identified (in the weakiv specification). Of course, either of these choices needs to be justifiable!

        Comment


        • #5
          Since xtabond2 is a blackbox it would be hard to make that kind of fine grained justification...I don't really know how to identify those 16-17 regressors in the xtabond2. How to do that?

          Instead what I did was remove the level equation from the ivstyle().
          This specification reduces endogenous regressors to 6. Now I run :

          weakiv, gridpoints(4 4 4 4 4 4) kjlevel(95 95)

          and find confidence intervals as well

          .............................................
          Weak instrument robust tests for linear IV
          H0: beta[lnaq:L.lnaq L2.lnaq da sa asset cx] = [0 0 0 0 0 0]
          ----------------------------------------
          Test | Statistic p-value
          ------+---------------------------------
          CLR | stat(.) = 57.54 0.0000
          K | chi2(6) = 45.88 0.0000
          J | chi2(9) = 12.69 0.1770
          K-J | <n.a.> 0.0000
          AR | chi2(15) = 58.57 0.0000
          ------+---------------------------------
          Wald | chi2(6) = 347.88 0.0000
          ----------------------------------------
          Confidence sets estimated for (4 x 4 x 4 x 4 x 4 x 4) points in [ .07476, 1.23276], [-.371474, .47027], [-.369832, .350847], [ -.04753, .14162], [-.105619, .145412],
          [-6.87575, 3.59872].
          CLR distribution and p-values obtained by simulation (10000 draws).
          Number of obs N = 6228. Number of groups = 333; avg obs per group = 9.8.
          Method = lagrange multiplier (LM). Weight on K in K-J test = 0.800.
          Tests robust to heteroskedasticity and clustering on serial (N_clust=333). Small sample adjustments were used.
          Wald statistic in last row is based on xtabond2 estimation and is not robust to weak instruments.

          My inference:

          (1) CLR: Default null that all 6 parameters are zero is rejected given that exogeneity conditions E(Zu)=0 are assumed to be satisfied for default 95% confidence level. GOOD for me
          (2) K : similar as above. GOOD for me
          (3) J : The null exogeneity conditions E(Zu)=0 is not rejected (satisfied) GOOD for me
          (4) K-J: with 95%K and 95%J confidence level does not show the statistic. But p value shows that the null is rejected. GOOD for me
          (5) AR : Joint test of the structural parameter and the exogeneity of the instruments rejected (Previous results show that it may also be GOOD for me)

          Additionally, since the confidence sets for Wald test is much wider than those of above statistics, we can infer that our instruments are strong.

          Am I right in my inferences?

          Comment


          • #6
            Mostly yes. You can't really infer something about the strength of the instruments from the Wald test; you really need a test of under- or weak-identification. Also, and this is just terminology, no confidence intervals are being reported - these are all just test statistics and p-values for the specified null hypothesis. But your interpretations in (1)-(5) look OK.

            An option to consider if you are still after confidence intervals or confidence sets is to use projection-based inference using the project(_all) option. This will give you conservative confidence intervals that might still be useful. It's explained in detail in the weakiv help file.

            Comment

            Working...
            X