Announcement

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

  • 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:


  • Sebastian Kripfganz
    replied
    I am afraid there was another bug in xtdpdgmm that is now fixed with the latest update to version 2.3.8:
    Code:
    net install xtdpdgmm, from(http://www.kripfganz.de/stata) replace
    This bug could lead to an unexpected error message or incorrect results from postestimation commands after estimating a model with nonlinear moment conditions.

    Thanks to Tiyo Ardiyono for reporting this problem.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    With the usual thanks to Kit Baum, the latest version 2.3.7 of xtdpdgmm with all the bug fixes mentioned here over the last year is now also available on SSC.
    Code:
    adoupdate xtdpdgmm, update

    Leave a comment:


  • Kayode Olaide
    replied
    Thank you so much for your response. I don't seem to know how to start a new post on this platform. I actually posted my query here because I could not figure that out .

    Leave a comment:


  • Sebastian Kripfganz
    replied
    Originally posted by Kayode Olaide View Post
    I'm using the CCE estimation technique for a research work. My dataset consists of eight cross-sectional units (N) and 24 time (T) dimensions in each cross-sectional unit, and I'm using Stata for my estimation. The cross-sectional dependence test shows that the panels are cross-sectionally dependent. Also, the variables have mixed order of integration (stationarity), i.e., I(0) and I(1). Both the CCEMG and CCEPMG don't seem to be quite appropriate for my dataset. Please, I need help finding a suitable estimation technique, and will really appreciate suggestions. Thank you.
    This does not seem to be the right topic for your query. GMM estimators for dynamic panel data models are typically designed for large-N, small-T panels. Your data does not appear to be suitable. Please start a new topic with an informative title, so that others can help as well. In any case, with such a small N, you cannot really account for common correlated effects unless you have some appropriate proxy variables for them (i.e. "global" variables that are constant across units).

    Leave a comment:


  • Kayode Olaide
    replied
    I'm using the CCE estimation technique for a research work. My dataset consists of eight cross-sectional units (N) and 24 time (T) dimensions in each cross-sectional unit, and I'm using Stata for my estimation. The cross-sectional dependence test shows that the panels are cross-sectionally dependent. Also, the variables have mixed order of integration (stationarity), i.e., I(0) and I(1). Both the CCEMG and CCEPMG don't seem to be quite appropriate for my dataset. Please, I need help finding a suitable estimation technique, and will really appreciate suggestions. Thank you.

    Leave a comment:


  • Sebastian Kripfganz
    replied
    The rejections of the AR(3) and the Hansen test indicate that the model is still potentially misspecified, e.g. further lags could be needed or some other relevant variables might be omitted. Often, the tests do not provide any specific guidance about the source of the problem. You could use difference-in-Hansen tests to see if there is a problem with any particular variable. (See for example the section on "Model Selection" in my 2019 London Stata Conference presentation.) I would still recommend not to use all available lags of yield_mtha yield_dev. Restricting the lag length might improve the reliability of the specification tests.

    Regarding the magnitude of the bias for the coefficient \(\rho\) of the lagged dependent variable (when there is only one lag), it can be approximated as \(-(1+\rho) / (T-1)\). Thus, e.g. for \(\rho = 0.6\) and \(T = 28\), we would get a bias of approximately -0.06. This may still be too large to be tolerated. There is no specific rule of thumb.

    Leave a comment:

Working...
X