Announcement

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

  • #46
    il sent you my data into your mail to try. thanks

    Comment


    • #47
      Please professor I sent you my data into your mail

      Comment


      • #48
        Professor I have a same problem I don't why? please help me

        Comment


        • #49
          Even with your data, I could not identify a problem.
          https://twitter.com/Kripfganz

          Comment


          • #50
            I will change my stata version if I have the same i will come back to you

            Comment


            • #51
              Dear prof. Kripfganz,

              Hi, I have a question if there's any way to implement Difference GMM than System GMM in the first stage. I've read your coauthored article and found that there's no restriction for first-stage estimator and I'd like to employ Difference GMM in my case.

              I read 'help xtseqreg' and thought the option for gmmiv(.. difference model(difference)) was for Difference GMM but when I implemented 'xtabond2 ...' that you specified in your post as an equivalent way to mimic the first stage results, I found that it was System GMM. So I don't know how I could do Difference GMM with xtseqreg.
              Last edited by Jieun Lee; 25 Mar 2019, 04:09.

              Comment


              • #52
                Yes, you can use the difference GMM estimator in the first stage. Such an example is given in my [URL=https://www.statalist.org/forums/forum/general-stata-discussion/general/1374005-xtseqreg-new-stata-command-for-sequential-two-stage-gmm-estimation-of-linear-panel-models#post1374005]post #1[7URL] of this Statalist topic.

                Why do you believe it was system GMM?
                https://twitter.com/Kripfganz

                Comment


                • #53
                  Thank you for your information! I ran the code of 'xtabond2 ...' that you said in the post and Stata reported that it is 'Dynamic panel estimation - System GMM' and so I thought it was about System GMM. (Please refer to the attached captured files.)

                  So the 'xtseqreg' example in your link (or the very first post in this thread) is for Difference GMM then?
                  Attached Files
                  Last edited by Jieun Lee; 25 Mar 2019, 06:46.

                  Comment


                  • #54
                    To be precise, you obtain the difference GMM estimator by adding the option noconstant to the xtseqreg command, and equivalently the option noleveleq to the xtabond2 command. As you will notice, the constant term disappears from the regression output but all the other coefficients remain the same.
                    https://twitter.com/Kripfganz

                    Comment


                    • #55
                      Oh, I see. I really appreciate your kind and quick feedback!

                      Comment


                      • #56
                        Hi, I am estimating a dynamic panel model for trade. The model is:

                        lnexports l.lnexports lngdpi lngdpj lndistance inflationi inflationj hombias

                        Where I am treating l.lnexports as endogenous and for the moment assuming other regressors are exogenous. The coefficients of interest are the homebias dummies which are equal to 1 if shipments travel within a country. I have data for T=3 and N=6912 and it is a balanced panel.

                        I had two questions. First I have just read this thread, your paper with Schwartz and wanted to quickly check whether I have successfully implemented this above model for XTSEQREG as I want to implement a system GMM estimation (Blundell and Bond 1998) to address endogeneity in l.lnexports.

                        Code:
                         xtseqreg lnexports l.lnexports lngdpi lngdpj lndistance neighbour homebias,  ///
                        gmm(l.lnexports, lag(1 2) collapse model(difference))  ///
                        iv(l.lnexports, difference model(level))///
                        iv(lngdpi lngdpj lndistance neighbour homebias priceincreasei priceincreasej , difference model(level)) twostep vce(robust) 
                        estimate store gmm1
                        xtseqreg lnexports (l.lnexports lngdpi lngdpj lndistance neighbour homebias) lndistance neighbour homebias, ///
                        vce(robust) first(gmm1, nocons)   iv(lngdpi lngdpj inflationi inflationj)

                        Secondly following the literature for the pooled OLS I have computed time varying origin and destination fixed effects as well as split my homebias dummy by year, thus forming: hombias1 homebias2 and homebias3. Since neither are time invariant would you suggest implementing system GMM using xtabond2?

                        Many Thanks,

                        Samuel

                        Comment


                        • #57
                          It is not entirely clear from your question but I assume that lndistance neighbour homebias are time-invariant variables. In any case, you should not specify the same variables in the first and second stage. Your first-stage model should not include these three variables in this case (neither in the regressor list nor in the list of instruments). Other than that, the specification looks alright, assuming that inflation and GDP are relevant and valid instruments, i.e. correlated with the time-invariant variables and uncorrelated with the unobserved effects.

                          When you interact the the time-invariant variables with time dummies (to obtain hombias1 homebias2 homebias3), the two-stage approach might be harder to justify. A (system) GMM approach is applicable here. The following Statalist topic provides more information on GMM estimation of dynamic panel models in Stata:
                          XTDPDGMM: new Stata command for efficient GMM estimation of linear (dynamic) panel models with nonlinear moment conditions
                          https://twitter.com/Kripfganz

                          Comment


                          • #58
                            Dear Sebastian,

                            I have a question about the consistency of results between the xtabond2 and the xtseqreg commands. I am estimating a production function using a panel dataset of the following form.

                            Code:
                            xtset q1 time
                            panel variable: q1 (unbalanced)
                            time variable: time, 1 to 3, but with gaps
                            delta: 1 unit
                            Here is the output when I run the xtabond2 command:

                            Code:
                            .xtabond2 lnlabprod_v3 capprod rawprod npprod dummy maxprod i.Year if (q13a ==1 & q11a == 0 & industry_same ==1), gmm
                            >  (lnlabprod_v3 capprod rawprod npprod dummy maxprod, lag(2 2) eq(level)) gmm (lnlabprod_v3 capprod rawprod npprod du
                            > mmy maxprod, lag(2 2) eq(diff)) iv(i.Year i.q17a, eq(level)) iv(i.q17a, eq(diff)) robust twostep
                            Favoring speed over space. To switch, type or click on mata: mata set matafavor space, perm.
                            Warning: Two-step estimated covariance matrix of moments is singular.
                              Using a generalized inverse to calculate optimal weighting matrix for two-step estimation.
                              Difference-in-Sargan/Hansen statistics may be negative.
                            
                            Dynamic panel-data estimation, two-step system GMM
                            ------------------------------------------------------------------------------
                            Group variable: q1                              Number of obs      =      5612
                            Time variable : time                            Number of groups   =      2982
                            Number of instruments = 44                      Obs per group: min =         1
                            Wald chi2(8)  =  16799.40                                      avg =      1.88
                            Prob > chi2   =     0.000                                      max =         3
                            ------------------------------------------------------------------------------
                                         |              Corrected
                            lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                 capprod |   .1737902    .068021     2.55   0.011     .0404714     .307109
                                 rawprod |   .0695543   .0560353     1.24   0.215    -.0402729    .1793815
                                  npprod |   .2612364   .1383583     1.89   0.059    -.0099408    .5324136
                                   dummy |    3.12106   1.320894     2.36   0.018     .5321542    5.709965
                                 maxprod |   .4540816    .180837     2.51   0.012     .0996476    .8085157
                                         |
                                    Year |
                                   2011  |          0  (empty)
                                   2013  |  -4.680937    .047691   -98.15   0.000    -4.774409   -4.587464
                                   2015  |  -4.759981    .054865   -86.76   0.000    -4.867515   -4.652448
                                         |
                                   _cons |   10.94667   1.147688     9.54   0.000     8.697245     13.1961
                            ------------------------------------------------------------------------------
                            Instruments for first differences equation
                              Standard
                                D.(0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a
                                10.q17a 11.q17a 12.q17a 13.q17a 14.q17a 15.q17a 16.q17a 17.q17a 18.q17a
                                19.q17a 20.q17a)
                              GMM-type (missing=0, separate instruments for each period unless collapsed)
                                L2.(lnlabprod_v3 capprod rawprod npprod dummy maxprod)
                            Instruments for levels equation
                              Standard
                                2011b.Year 2013.Year 2015.Year 0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a
                                6.q17a 7.q17a 8.q17a 9.q17a 10.q17a 11.q17a 12.q17a 13.q17a 14.q17a
                                15.q17a 16.q17a 17.q17a 18.q17a 19.q17a 20.q17a
                                _cons
                              GMM-type (missing=0, separate instruments for each period unless collapsed)
                                DL2.(lnlabprod_v3 capprod rawprod npprod dummy maxprod)
                            ------------------------------------------------------------------------------
                            Arellano-Bond test for AR(1) in first differences: z =  -5.90  Pr > z =  0.000
                            Arellano-Bond test for AR(2) in first differences: z =      .  Pr > z =      .
                            ------------------------------------------------------------------------------
                            Sargan test of overid. restrictions: chi2(35)   =  75.26  Prob > chi2 =  0.000
                              (Not robust, but not weakened by many instruments.)
                            Hansen test of overid. restrictions: chi2(35)   =  38.54  Prob > chi2 =  0.312
                              (Robust, but weakened by many instruments.)
                            
                            Difference-in-Hansen tests of exogeneity of instrument subsets:
                              gmm(lnlabprod_v3 capprod rawprod npprod dummy maxprod, eq(diff) lag(2 2))
                                Hansen test excluding group:     chi2(29)   =  30.33  Prob > chi2 =  0.397
                                Difference (null H = exogenous): chi2(6)    =   8.21  Prob > chi2 =  0.223
                              iv(2011b.Year 2013.Year 2015.Year 0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a 10.q17a 11.
                            > q17a 12.q17a 13.q17a 14.q17a 15.q17a 16.q17a 17.q17a 18.q17a 19.q17a 20.q17a, eq(level))
                                Hansen test excluding group:     chi2(16)   =  10.85  Prob > chi2 =  0.818
                                Difference (null H = exogenous): chi2(19)   =  27.69  Prob > chi2 =  0.090
                              iv(0b.q17a 1.q17a 2.q17a 3.q17a 4.q17a 5.q17a 6.q17a 7.q17a 8.q17a 9.q17a 10.q17a 11.q17a 12.q17a 13.q17a 14.q17a 15
                            > .q17a 16.q17a 17.q17a 18.q17a 19.q17a 20.q17a, eq(diff))
                                Hansen test excluding group:     chi2(17)   =  23.73  Prob > chi2 =  0.127
                                Difference (null H = exogenous): chi2(18)   =  14.81  Prob > chi2 =  0.675
                            There are 50 instruments that have been used above. Now, I run a similar command using xtsreqreg:

                            Code:
                            . xi: xtseqreg lnlabprod_v3 capprod rawprod npprod dummy maxprod if (q13a == 1 & q11a == 0 & industry_same ==1), gmmiv
                            >  (lnlabprod_v3 capprod rawprod npprod dummy maxprod, lag (2 2) model(level)) gmmiv (lnlabprod_v3 capprod rawprod npp
                            > rod dummy maxprod, lag (2 2) model(diff)) iv(i.Year i.q17a, model(level)) iv(i.q17a, model(diff)) teffects vce(robus
                            > t) twostep
                            i.Year            _IYear_2011-2015    (naturally coded; _IYear_2011 omitted)
                            i.q17a            _Iq17a_0-20         (naturally coded; _Iq17a_0 omitted)
                            
                            Group variable: q1                           Number of obs         =      5612
                            Time variable: time                          Number of groups      =      2982
                            
                                                                         Obs per group:    min =         1
                                                                                           avg =  1.881958
                                                                                           max =         3
                            
                                                                         Number of instruments =        50
                            
                                                                 (Std. Err. adjusted for clustering on q1)
                            ------------------------------------------------------------------------------
                                         |              WC-Robust
                            lnlabprod_v3 |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                            -------------+----------------------------------------------------------------
                                 capprod |    .217903   .0325344     6.70   0.000     .1541367    .2816693
                                 rawprod |    .065866    .035395     1.86   0.063     -.003507     .135239
                                  npprod |   .4307212   .0701663     6.14   0.000     .2931978    .5682446
                                   dummy |  -.5710566   .2646682    -2.16   0.031    -1.089797   -.0523164
                                 maxprod |  -.0702817   .0373012    -1.88   0.060    -.1433908    .0028274
                                         |
                                    time |
                                      2  |  -4.613127   .0382481  -120.61   0.000    -4.688092   -4.538162
                                      3  |   -4.65214    .036684  -126.82   0.000     -4.72404   -4.580241
                                         |
                                   _cons |   13.80343   .5484781    25.17   0.000     12.72843    14.87843
                            ------------------------------------------------------------------------------
                            As you can see, some of the coefficients are completely changing signs and significance. Also, the instrument count has reduced to 44. Am I not replicating the code properly?

                            Thanks a lot for your help, in advance.

                            Suchita

                            Comment


                            • #59
                              Sorry, just a correction, the instrument count is 44 for the GMM and 50 for the xtseqreg and not the reverse, as I previously stated.

                              Comment


                              • #60
                                By default, xtabond2 creates first differences of the GMM-type instruments for the level equation and of the standard instruments for the first-differenced equation. With xtseqreg, you need to explicitly specify the difference suboption because by default no such transformation is applied, i.e.
                                Code:
                                gmmiv(..., difference lag (2 2) model(level)) iv(..., difference model(diff))
                                https://twitter.com/Kripfganz

                                Comment

                                Working...
                                X