Announcement

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

  • Akbar Isayev
    replied
    Dear Sebastian,

    I have a question related with how to apply interaction term in xtdpdgmm syntax. In xtabond2, when I want to interact var1 with var2, I have to write it like c.var1##c.var2 inside the syntax. What about xtdpdgmm? I tried same kind but it didn't work. I will appreciate if you provide an answer for me.

    Thanks in advance.

    Have a nice day.

    Leave a comment:


  • Akbar Isayev
    replied
    Thank you very much dear Sebastian.

    Have a nice day.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    1. The nonlinear moment conditions that are added with option nl(noserial) are redundant if gmm(depvar, lag(2 .) model(diff)) and gmm(depvar, diff lag(1 1) model(level)) are also specified; see Blundell and Bond (1998, Journal of Econometrics, page 124). Strictly speaking, this redundancy only holds if there is no curtailing and no collapsing of the instruments, although I probably would not use this as an argument to add nonlinear moment conditions to a system GMM estimator. So, yes, in general there is no need for adding nonlinear moment conditions to a system GMM estimator that has lagged levels of the dependent variable as instruments for the first-differenced model and the first-differenced lagged dependent variable as an instrument for the level model.

    2. You do not necessarily have to add all of these instruments for the level model if you believe that some of them are not needed or not valid. You can still call it a "system GMM" estimator as long as you include some of them.

    Leave a comment:


  • Akbar Isayev
    replied
    Dear Sebastian Kripfganz,

    I have 2 questions related with xtdpdgmm:

    1) In your London Stata Conference slides there is a sentence: "These nonlinear moment conditions are redundant when added to the sys-GMM moment conditions (Blundell and Bond, 1998) but improve efficiency when added to the diff-GMM moment conditions" related with nonlinear moment conditions. Does this mean that using noserial option with system GMM is meaningless? In other words, while applying system GMM there is no need for adding nonlinear moment conditions. Am I correct?

    2) As I understand from the xtdpdgmm syntax, when you add differenced instruments for level form to the difference GMM syntax it becomes system GMM. And inside xtdpdgmm syntax, you have to categorize all variables that exist in main model as instruments (endogenous, predetermined and exogenous). For example:

    e endogen
    p predetermined
    s strictly exogenous

    xtdpdgmm L(0/1).depvar e p s, model(diff) collapse gmm(depvar, lag(2 .)) gmm(e, lag(2 .)) gmm(p, lag(1 .)) gmm(s, lag(0 .)) two vce(r) teffects nofooter

    Now my questions is: when you add differenced instruments for level form to go for system GMM, should we categorize all variables as instruments for level form? Or we can use some of them? In other words, can we add only lets say gmm(depvar e p, lag(1 1) m(l) diff) to the abovementioned syntax to make it system GMM or we have to add all variables like gmm(depvar e p, lag(1 1) m(l) diff) gmm(s, lag(0 0) m(l) diff) ?
    Just to make sure I am asking my question in a right way I put it in another way: Should we categorize all variables as differenced instruments for level form? or some of them will be enough in terms of syntaxing for system GMM?

    Thank you in advance

    Leave a comment:


  • Sebastian Kripfganz
    replied
    xtdpdgmm does not support constrained estimation, but testing linear restrictions after the estimation is possible:
    Code:
    test _b[x1] = 1
    or
    Code:
    test x1 = 1

    Leave a comment:


  • Jerry Kim
    replied
    Hi Dr. Kripfganz,

    Thank you for the effort on this package which does help researchers a lot. I have a small question regarding the constraint on coeffcients. Let's say if I wish to set a predetermined variable's coefficient to 1 as an additional constraint, does xtdpdgmm support the following kind of coding currently

    Code:
    constraint 1 x1 = 1
    Or maybe this type:

    Code:
    test _b1 = 1
    Thank you!

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I have fixed a minor bug in xtdpdgmm that could result in an incorrect error message in rare instances when using option vce(cluster) on a subsample of the data. The new version 2.3.9 is available on my website:
    Code:
    net install xtdpdgmm, from(http://www.kripfganz.de/stata/) replace

    Leave a comment:


  • Sebastian Kripfganz
    replied
    I am not sure to what "errors" you are referring. Clearly, it is troubling that so many coefficients are omitted. The main problem appears to be with your data: You only have 7 groups which is way too few for this type of estimation. I am afraid the kind of subset analysis you would like to do is infeasible. You might want to introduce some interaction effects (country group dummies with regressors of particular interest) into the estimation on the whole sample instead.

    Leave a comment:


  • Vaibhav Puri
    replied
    Dear Prof. Kripfganz

    I am new to Panel Data regression and to the xtdpdgmm syntax.

    In my research, I am using a subset of 58 country-specific data over 14 years .

    The following is the model which I used for larger number of countries (around 190) but wanted to check the same for the subset of country groupings. I am getting some errors:

    xtdpdgmm LFPR_FEM_TOT l.LFPR_FEM_TOT LnGDP_2017 Sq_LnGDP_2017 Ln_Rail_Norm Fertility_Rate Indv_Internet_PerPop urbn_pop_tot Trade_Per_GDP if Year>2009, twostep vce(cluster CCode) teffects gmmiv(l.LFPR_FEM_TOT, lag(0 5) collapse model(fodev)) gmmiv(LnGDP_2017, lag(1 5) collapse model(fodev)) gmmiv(Ln_Rail_Norm Fertility_Rate Indv_Internet_PerPop urbn_pop_tot Trade_Per_GDP, lag(1 2) collapse model(level)) nofootnote

    Click image for larger version

Name:	Screenshot 2021-09-02 at 2.16.53 AM.png
Views:	1
Size:	133.5 KB
ID:	1625864



    Kindly guide me about the mistakes I am making and the errors in model specification. How can I improve upon them and in building the model?
    Last edited by Vaibhav Puri; 01 Sep 2021, 15:01.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The problem reported by Chen ly had been fixed with the recent update to version 2.3.8. This version is now also available on SSC.

    Leave a comment:


  • Chen ly
    replied
    Thank you so much, professor Kripfganz. I have already sent the e-mail to you, please check it. I am looking forward to hearing from you.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Chen ly
    The error message about the conformability error sounds like a bug in the code of xtdpdgmm, although I cannot replicate it with other data sets. Whether you use collapse or not, you should not see this error message. May I ask if you are using the latest version of the command (2.3.8)? (Type which xtdpdgmm to see the version you are using.)
    If you are using the latest version, would it be possible to share your data set with me by e-mail so that I can investigate the problem?

    Leave a comment:


  • Chen ly
    replied
    Hello Dr. Kripfganz,
    I really appreciate all your work.

    I am currently having trouble with my dynamic model. N = 299. T = 5.

    I tried to use the postestimation command " estat hausman " to carry out the generalized Hausman test. Here are my codes.

    HTML Code:
    xtdpdgmm L(0/1).surplus3 L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g  invest poprate , model(fod)  ///  
    gmm(surplus3, lag(1 2) ) gmm(L.debt CL.debt#CL.debt#CL.debt ,lag(1 2) collapse) ///
    gmm(GSF,lag(1 2) )  gmm(BCF,lag(0 .) collapse) gmm(TOR,lag(0 .)) gmm(g,lag(1 .) collapse) ///
    gmm(invest,lag(1 2) collapse)  gmm(poprate,lag(0 2) collapse)  ///
    gmm(BCF TOR poprate,lag(0 0) model(md)) ///
    gmm(surplus3, lag(1 1) diff model(level)) ///
    gmm(L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g invest poprate, lag(0 0) diff model(level)) ///
    teffects two vce(r)  nl(iid) 
    
    estimates store iid
    
    xtdpdgmm L(0/1).surplus3 L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g  invest poprate , model(fod)  ///  
    gmm(surplus3, lag(1 2) ) gmm(L.debt CL.debt#CL.debt#CL.debt ,lag(1 2) collapse) ///
    gmm(GSF,lag(1 2) )  gmm(BCF,lag(0 .) collapse) gmm(TOR,lag(0 .)) gmm(g,lag(1 .) collapse) ///
    gmm(invest,lag(1 2) collapse)  gmm(poprate,lag(0 2) collapse)  ///
    gmm(BCF TOR poprate,lag(0 0) model(md)) ///
    gmm(surplus3, lag(1 1) diff model(level)) ///
    gmm(L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g invest poprate, lag(0 0) diff model(level)) ///
    teffects two vce(r)  nl(noserial) 
    
    estat hausman iid
    However, it appears following mistakes: " conformability error: A matrix, vector, or scalar has the wrong number of rows and/or columns for what is required. Adding a 2 x 3 matrix to a 1 x 4 would result in this error."
    Then I modify my code as:
    HTML Code:
    xtdpdgmm L(0/1).surplus3 L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g  invest poprate , model(fod)  collapse ///  
    gmm(surplus3, lag(1 2) ) gmm(L.debt CL.debt#CL.debt#CL.debt ,lag(1 2) ) ///
    gmm(GSF,lag(1 2) )  gmm(BCF,lag(0 .) ) gmm(TOR,lag(0 .)) gmm(g,lag(1 .) ) ///
    gmm(invest,lag(1 2) )  gmm(poprate,lag(0 2) )  ///
    gmm(BCF TOR poprate,lag(0 0) model(md)) ///
    gmm(surplus3, lag(1 1) diff model(level)) ///
    gmm(L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g invest poprate, lag(0 0) diff model(level)) ///
    teffects two vce(r)  nl(iid) 
    
    estimates store iid
    
    xtdpdgmm L(0/1).surplus3 L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g  invest poprate , model(fod)  collapse ///  
    gmm(surplus3, lag(1 2) ) gmm(L.debt CL.debt#CL.debt#CL.debt ,lag(1 2) ) ///
    gmm(GSF,lag(1 2) )  gmm(BCF,lag(0 .) ) gmm(TOR,lag(0 .)) gmm(g,lag(1 .) ) ///
    gmm(invest,lag(1 2) )  gmm(poprate,lag(0 2) )  ///
    gmm(BCF TOR poprate,lag(0 0) model(md)) ///
    gmm(surplus3, lag(1 1) diff model(level)) ///
    gmm(L.debt CL.debt#CL.debt#CL.debt GSF BCF TOR g invest poprate, lag(0 0) diff model(level)) ///
    teffects two vce(r)  nl(noserial)
    It showed that the error disappears when taking all instruments "collapse". So I have two queries.
    First, why is this a problem? Is it " nl(noserial)" should cooperated with "collapse"?
    Second, is there any obvious error in my code?
    Again I really appreciate all your work, thank you in advance.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Importantly, gmm(ln_output, lag(1 1) model(level)) does not automatically create differences of the instruments for the level model. You also need to add the difference suboption: gmm(ln_output, lag(1 1) diff model(level))

    It is surprising that your model still seems to pass all of the overidentification tests because it clearly should not. Using levels of the lagged dependent variable as instruments for the level model violates the underlying assumptions (unless there are actually no unobserved unit-specific effects present).

    In principle, you could use a "level GMM" estimator that only uses first differences as instruments for the level model. But if those instruments are valid, then typically those for the first-differenced model should be valid as well and normally they would help with the identification. However, it could be that the instruments for the first-differenced model are quite weak, in which case it might indeed make sense to drop them.

    If the model is underidentified, then all other statistics based on that model need to be interpreted with caution. They may not be reliable.

    Leave a comment:


  • Tiyo Ardiyono
    replied
    Dear Sebastian,

    I tried to get the best specification for my model by referring to Kiviet (2019) and Kripfganz (2019) using XTDPDGMM. I started with the endogenous model below as a start, but as we can see, it does not pass the under-identification test. However, its Hansen test, difference-in-Hansen, and AR2 requirement are all satisfied.

    Code:
    xtdpdgmm L(0/1).ln_output $var, coll model(diff) gmm(ln_output, lag(2 .)) gmm(ln_export, lag(2 .)) gmm(lgm2int, lag(2 .)) gmm(c.ln_export#c.lgm2int, lag(2 .)) gmm(ln_v1115, lag(2 .)) teffect two overid vce(robust) small
    Under-identification test:
    Code:
    underid, overid underid kp sw noreport
    Code:
    collinearity check...
    collinearities detected in [Y X Z] (right to left): __alliv_18 __alliv_17 __alliv_16
    collinearities detected in [X Z Y] (right to left): 2012.year 2011.year 2010bn.year
    warning: collinearities detected, reparameterization may be advisable
    
    Overidentification test: Kleibergen-Paap robust LIML-based (LM version)
      Test statistic robust to heteroskedasticity and clustering on psid
    j=    3.74  Chi-sq( 10) p-value=0.9584
    
    Underidentification test: Kleibergen-Paap robust LIML-based (LM version)
      Test statistic robust to heteroskedasticity and clustering on psid
    j=    9.92  Chi-sq( 11) p-value=0.5378
    
    2-step GMM J underidentification stats by regressor:
    j=   12.40  Chi-sq( 11) p-value=0.3345 L.ln_output
    j=   16.89  Chi-sq( 11) p-value=0.1112 ln_export
    j=   11.07  Chi-sq( 11) p-value=0.4371 lgm2int
    j=   11.38  Chi-sq( 11) p-value=0.4123 c.ln_export#c.lgm2int
    j=   22.75  Chi-sq( 11) p-value=0.0191 ln_v1115
    j=   24.55  Chi-sq( 11) p-value=0.0106 2010bn.year
    j=   24.55  Chi-sq( 11) p-value=0.0106 2011.year
    j=   24.55  Chi-sq( 11) p-value=0.0106 2012.year
    Then I did some steps: (i) treating the variables as predetermined or exogenous, (ii) using differences as instruments for the level model (Blundell & Bond), and (iii) non-linear moment condition (Ahn & Schmidt). These steps did not reject the under-identification test (KP p-value are all above 0.10). The only approach that satisfies the Kiviet(2019) guidance: Hansen p-value > 0.20, difference-in-Hansen p-value > 0.20, AR-2 p-value > 0.20 (in this case > 0.10), and also pass the under-identification test is the model below.

    Code:
    xtdpdgmm L(0/1).ln_output $var, coll model(diff)  gmm(ln_output, lag(2 .)) gmm(ln_output, lag(1 1) model(level)) gmm(ln_v1115, lag(1 1) model(level)) teffect two overid vce(robust) small gmm(ln_export, lag(1 1) model(level)) gmm(lgm2int, lag(1 1) model(level)) gmm(c.ln_export#c.lgm2int, lag(1 1) model(level))
    Code:
    estat overid, difference
    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(diff) |     0.0000      0         . |      1.8547      3    0.6031
      2, model(level) |     1.5235      2    0.4669 |      0.3312      1    0.5649
      3, model(level) |     1.6436      2    0.4396 |      0.2111      1    0.6459
      4, model(level) |     1.6813      2    0.4314 |      0.1734      1    0.6771
      5, model(level) |     1.6548      2    0.4372 |      0.2000      1    0.6548
      6, model(level) |     1.7867      2    0.4093 |      0.0680      1    0.7943
      7, model(level) |     0.0000      0         . |      1.8547      3    0.6031
         model(level) |          .     -5         . |           .      .         .
    Code:
    . estat serial, ar(1/2)
    
    Arellano-Bond test for autocorrelation of the first-differenced residuals
    H0: no autocorrelation of order 1:     z =         .   Prob > |z|  =         .
    H0: no autocorrelation of order 2:     z =    1.4313   Prob > |z|  =    0.1523
    Code:
    . underid, underid kp sw noreport
    
    collinearity check...
    collinearities detected in [Y X Z] (right to left): __alliv_11 __alliv_10 __alliv_9 __alliv_4
    collinearities detected in [X Z Y] (right to left): 2012.year 2011.year 2010bn.year L.ln_output
    warning: collinearities detected, reparameterization may be advisable
    
    Underidentification test: Kleibergen-Paap robust LIML-based (LM version)
      Test statistic robust to heteroskedasticity and clustering on psid
    j=   95.61  Chi-sq(  4) p-value=0.0000
    
    2-step GMM J underidentification stats by regressor:
    j=  111.89  Chi-sq(  4) p-value=0.0000 L.ln_output
    j=   90.59  Chi-sq(  4) p-value=0.0000 ln_export
    j=   74.49  Chi-sq(  4) p-value=0.0000 lgm2int
    j=   72.65  Chi-sq(  4) p-value=0.0000 c.ln_export#c.lgm2int
    j=   97.95  Chi-sq(  4) p-value=0.0000 ln_v1115
    j=  942.49  Chi-sq(  4) p-value=0.0000 2010bn.year
    j=  942.49  Chi-sq(  4) p-value=0.0000 2011.year
    j=  942.49  Chi-sq(  4) p-value=0.0000 2012.year
    My questions are:
    1. Is this approach valid? Kiviet(2019) and Kripfganz(2019) provide examples started from Arellano-Bond followed by adding the differences as instruments for level. In my approach, all covariates rather than lagged-dependent variables only have differences for the level model.
    2. If it is valid, can I say this one as system GMM (Blundel & Bond model)?
    3. The MMSC prefer the first model to the second one, but the first one does not pass the under-identification test. Does it make sense that MMSC prefer an unproperly specified model?

    Thank you very much.

    Cheers,
    Tiyo
    Last edited by Tiyo Ardiyono; 17 Aug 2021, 06:44. Reason: Typo

    Leave a comment:

Working...
X