Announcement

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

  • Sebastian Kripfganz
    replied
    An important update to version 2.6.9 is now available for xtdpdgmm from my personal website, which fixes the bug just mentioned in the previous post, where some of the Difference-in-Hansen test statistics obtained after running xtdpdgmm with option overid had been incorrect. (The source of the bug was an incorrect selection of the relevant moments when combining all instruments for the level model or a transformed model.)
    Code:
    net install xtdpdgmm, from(http://www.kripfganz.de/stata/) replace

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The first column, labelled "Excluding", provides an overidentification test for a model without the instruments from the respective row. If this test rejects the null hypothesis, then this indicates that even without those instruments the model might be misspecified. In this case, adding the respective instruments would not help, even if the additional ones were all valid, because there are still some invalid instruments. Thus, testing those additional instruments would not be feasible. This is because the column labelled "Difference" effectively compares the Hansen test for the full model with all instruments to the initial model from the "Excluding" column. But if this initial model is misspecified, then the "Difference" test would compare the full model to a misspecified model. Consequently, if both models are similarly misspecified, it the "Difference" test might not reject. But this could be misleading. Therefore, looking at the "Difference" test really only makes sense when the "Excluding" test is successfully passed.

    The last two rows in your table are basically a combination of rows 1-2 and rows 3-4, respectively. For example, in the last row the "Excluding" test jointly excludes all the instruments for the level model from rows 3 and 4, and the "Difference" test compares the full model to this model with those excluded instruments.

    While I understand why the degrees of freedoms in the last two rows are identical - this is because there is an equal number of instruments for the level model and the transformed model - I am bit puzzled about the numerically identical values of the test statistic. This looks a bit odd and appears to be a bug!

    Leave a comment:


  • Matej Korinek
    replied
    Dear professor Kripfganz, Sebastian Kripfganz

    I am just wondering about the following. I went through your 2019 London Stata Conference presentation very carefully. I am not sure how to exactly interpret the Incremental overidentification test. In particular, I have the following output:

    Sargan-Hansen (difference) test of the overidentifying restrictions
    H0: (additional) overidentifying restrictions are valid

    2-step weighting matrix from full model

    | Excluding | Difference
    Moment conditions | chi2 df p | chi2 df p
    ------------------+-----------------------------+-----------------------------
    1, model(fodev) | 249.0901 235 0.2521 | 5.7804 13 0.9538
    2, model(fodev) | 171.4524 131 0.0102 | 83.4181 117 0.9919
    3, model(level) | 244.7790 235 0.3172 | 10.0916 13 0.6864
    4, model(level) | 170.3794 131 0.0118 | 84.4912 117 0.9897
    model(fodev) | 151.3709 118 0.0208 | 103.4997 130 0.9581
    model(level) | 151.3709 118 0.0208 | 103.4997 130 0.9581

    Sargan-Hansen test of the overidentifying restrictions
    H0: overidentifying restrictions are valid

    2-step moment functions, 2-step weighting matrix chi2(248) = 254.8706
    Prob > chi2 = 0.3686

    2-step moment functions, 3-step weighting matrix chi2(248) = 265.6096
    Prob > chi2 = 0.2111

    For example, the first row tells me the Hansen J statistic from the whole moment matrix excluding 13 moment conditions (I have 13 collapsed lags of the dependent variable) and then the same statistics just for those 13 conditions.. In particular I do not understand those last two rows. What do they mean? How to interpret them? In particular, I know that the difference column should tell you the Hansen J statistics of just the level equation moments (or the fodev moments based on the particular row) but what model does those 118 moment conditions in the excluding column represent? I am just trying to understand that particular reduced model since it never passes in my models. That leads me to second question. I always nicely pass the difference criteria with p-value above 0.8 always. But frequently, I do not pass the reduced model in the excluding column. Is that a problem? How is that possible?

    Thank you for your time

    Matěj Kořínek

    Leave a comment:


  • Sebastian Kripfganz
    replied
    There is nothing wrong with these instruments per se. It is just a bit unusual that you are using different lag orders to instrument the lagged dependent variables and the independent variable. You should make sure that this can be justified; otherwise it looks like cherry picking a model specification that delivers the nicest results.

    For the controls, it is also unusual to not specify instruments for the transformed model; e.g., iv(l.(controls), m(fodev)).

    As a technical comment, note that gmm(l(1/2).DV, lag(0 0) collapse m(fodev)) is equivalent to iv(l(1/2).DV, m(fodev)).

    Leave a comment:


  • Nicu Sprincean
    replied
    Sebastian Kripfganz

    Hi, Sebastian,

    I have a question regarding a model specification where a I include the second lag of the dependent variable to deal with serial correlation. The model takes the following form:
    Code:
    xtdpdgmm DV l(1/2).DV l.IV l.(controls),  gmm(l(1/2).DV, lag(0 0) collapse m(fodev)) gmm(l.IV, lag(0 3) collapse m(fodev)) iv(l.(controls),d m(level)) teffects two vce(robust) nocons
    I assume that l.DV and l.IV are both predetermined - all right-hand side variables enter the model with a one-year lag, due to economic reasons, and all controls to be strictly exogeneous. I am not sure whether
    Code:
    gmm(l(1/2).DV, lag(0 0) collapse m(fodev))
    and
    Code:
    iv(l.(controls),d m(level))
    are correctly specified.

    Thank you in advance for your response!
    Last edited by Nicu Sprincean; 07 Feb 2025, 06:51.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Any standard econometrics textbook should cover systems of simultaneous equations and regressor endogeneity.

    A variable is predetermined if it is a function of (i.e., determined by) previous periods' shocks to the equation of interest (but not current or future periods' shocks).

    Leave a comment:


  • Nursena Sagir
    replied
    Dear Sebastian,

    Is there any reference that I can understand this better and explain why I can treat X_it as predetermined? I had difficulties to explain it in the method section of my paper. Or can you elaborate more on your reasoning?

    Best regards,
    Nursena

    Leave a comment:


  • Sebastian Kripfganz
    replied
    As long as you do not change the second equation, my earlier statement about Xit being predetermined still stands.

    Once Xit becomes a direct function of Yit, as in your amended second equation, Xit becomes endogenous.

    Leave a comment:


  • Nursena Sagir
    replied
    Dear Sebastian,

    I have a follow-up question.
    Originally posted by Sebastian Kripfganz View Post
    I think there are at least two things that are potentially confusing here.


    In your two-equations example. Xit is predetermined because it is a function of Yit-1. But Xit-1 is uncorrelated with the error term in εit (and any future error term) in equation 1, which is all that is needed for it to be a valid instrument (in the FOD-transformed model).
    You have stated that for the two-equations example below:
    1. Yit = Yit-1 + Yit-2 + Xit-1 + Xit-2 + εit
    2. Xit = Xit-1 + Xit-2 + Yit-1 + Yit-2 + εit
    If I change the first equation to:

    1. Yit = Yit-1 + Yit-2 + Xit + Xit-1 + εit

    which includes contemporaneous X, can I still assume that Xit is predetermined? When I look at the incJ test, it does not reject the null hypothesis that the additional overidentifying restriction for predetermined X is valid (p-value =0.95).

    Would your response change if I have second equation as:

    2. Xit = Xit-1 + Xit-2 + Yit + Yit-1 + εit

    Thank you in advance!

    Best regards,
    Nursena

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Yes, some of those lagged interaction terms will be equal to each other. As far as I can tell, this should be fine.

    Leave a comment:


  • Nursena Sagir
    replied
    Dear Sebastian,

    Thank you for your explanation. Specifying them explicitly added relevant instruments for interaction with the first lags but not with the second lags. Is this because L1.(0.gender#cL.depression) = (0.gender#cL2.depression), L2.(0.gender#cL.depression)=L1.(0.gender#cL2.depre ssion) so they are dropped in model 4 below? Can I still rely on the produced output with these dropped instruments?

    Code:
    Instruments corresponding to the linear moment conditions:
     1, model(fodev):
       L1.depression L2.depression L3.depression L4.depression
     2, model(fodev):
       L.income L1.L.income L2.L.income L3.L.income L4.L.income
     3, model(fodev):
       L1.(0.gender#cL.depression) L2.(0.gender#cL.depression)
       L3.(0.gender#cL.depression) L4.(0.gender#cL.depression)
     4, model(fodev):
       L4.(0.gender#cL2.depression)
     5, model(fodev):
       0.gender#cL.income L1.(0.gender#cL.income) L3.(0.gender#cL.income)
       L4.(0.gender#cL.income)
     6, model(fodev):
       L1.(0.gender#cL2.income) L4.(0.gender#cL2.income)
     7, model(level):
       3bn.wave 4.wave 5.wave 6.wave 7.wave 8.wave 9.wave 10.wave 11.wave 12.wave
       13.wave 14.wave 15.wave 16.wave 17.wave
    Best regards,
    Nursena

    Leave a comment:


  • Sebastian Kripfganz
    replied
    In the specification of the instruments, the base category for the gender dummy is ignored. The command creates interaction terms with both 0.gender and 1.gender. This leads to perfect collinearity with some of the non-interacted instruments, which is why some of them are dropped. You could explicitly specify interaction terms as c.L1.depression#0.gender etc to ensure that only this particular group is interacted.

    Leave a comment:


  • Nursena Sagir
    replied
    Dear Sebastian,

    Thank you for your reply. I use the following model as main estimation.

    Code:
     
     xtdpdgmm L(0/2).(depression) L(1/2).income, model(fodev) collapse gmm(depression, l(1 4))  gmm(L.income, l(0 4)) teffects two vce(r) nocons overid
    And the produced instrument list is below as expected.

    Code:
     
    Instruments corresponding to the linear moment conditions:
     1, model(fodev):
       L1.depression L2.depression L3.depression L4.depression
     2, model(fodev):
       L.income L1.L.income L2.L.income L3.L.income L4.L.income
     3, model(level):
       3bn.wave 4.wave 5.wave 6.wave 7.wave 8.wave 9.wave 10.wave 11.wave 12.wave
       13.wave 14.wave 15.wave 16.wave 17.wave
    However, when I add interaction terms for gender for all regressors, instrument set looks wrong.

    Code:
     
     xtdpdgmm L(0/2).(depression) L(1/2).income c.L1.depression#ib1.gender c.L2.depression#ib1.gender c.L1.income#ib1.gender c.L2.income#ib1.gender, model(fodev) collapse gmm(depression, l(1 4))  gmm(L.income, l(0 4)) gmm(c.L1.depression#ib1.gender, l(1 4)) gmm(c.L2.depression#ib1.gender, l(1 4))  gmm(c.L1.income#ib1.gender, l(0 4))  gmm(c.L2.income#ib1.gender, l(0 4)) teffects two vce(r) nocons overid
    As you can see below, it drops L3.depression from row 1 and L.income from row 2 as instrument. Then, shows arbitrary matches for gender categories and lags.

    Code:
    Instruments corresponding to the linear moment conditions:
     1, model(fodev):
       L1.depression L2.depression L4.depression
     2, model(fodev):
       L1.L.income L2.L.income L3.L.income L4.L.income
     3, model(fodev):
       L2.(0.gender#cL.depression) L4.(0.gender#cL.depression)
       L1.(1b.gender#cL.depression) L2.(1b.gender#cL.depression)
       L4.(1b.gender#cL.depression)
     4, model(fodev):
       L2.(0.gender#cL2.depression) L4.(0.gender#cL2.depression)
       L4.(1b.gender#cL2.depression)
     5, model(fodev):
       0.gender#cL.income L3.(0.gender#cL.income) 1b.gender#cL.income
     6, model(fodev):
       0.gender#cL2.income L1.(0.gender#cL2.income) L4.(0.gender#cL2.income)
       L3.(1b.gender#cL2.income) L4.(1b.gender#cL2.income)
     7, model(level):
       3bn.wave 4.wave 5.wave 6.wave 7.wave 8.wave 9.wave 10.wave 11.wave 12.wave
       13.wave 14.wave 15.wave 16.wave 17.wave
    Do you have any recommendation for me to correct the estimation code?

    Thank you in advance.

    Best regards,
    Nursena

    Leave a comment:


  • Sebastian Kripfganz
    replied
    In a nutshell: Yes.

    You should still think about what your model assumptions imply about the error term, because this will ultimately decide the instrument validity. If Xit is correlated with εit (because of simultaneity), then Xi,t-1 is predetermined with respect to εit (i.e., Xi,t-1 is uncorrelated with εit but correlated with εi,t-1). In the first-differenced model, the error term is εiti,t-1. Thus, Xi,t-1 would be correlated with this first-differenced error term but Xi,t-2 is not (assuming that the errors are not serially correlated). With the FOD transformation, the transformed errors are only a function of current (period t) and future errors. Thus, Xi,t-1 remains a valid instrument.

    Leave a comment:


  • Nursena Sagir
    replied
    Dear Sebastian,

    Thank you for your reply.

    Originally posted by Sebastian Kripfganz View Post

    In your two-equations example. Xit is predetermined because it is a function of Yit-1. But Xit-1 is uncorrelated with the error term in εit (and any future error term) in equation 1, which is all that is needed for it to be a valid instrument (in the FOD-transformed model).
    I'd like to clarify my understanding of instrument validity under different transformations.

    For my model: Yit = Yit-1 + Yit-2 + Xit-1 + Xit-2 + εit

    Under FOD transformation:
    • I can use L.Xit-1 as an instrument for Xit-1
    • And similarly L.Xit-2 as an instrument for Xit-2
    • While having Yit-1 and Yit-2 as regressors
    Under first-difference transformation:
    • I need to start from L2.Xit-1 as instrument bcs. Xit-1 appears in the differenced equation as (Xit-1 - Xit-2)
    Is my understanding of these different requirements under FOD versus first-differences correct?

    Thank you for your help in clarifying this.

    Best regards,
    Nursena

    Leave a comment:

Working...
X