Announcement

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

  • Comparing two coefficients in GMM

    Dear Stata users,

    I am using the Difference and System GMM approach for estimation and I want to compare the difference between two coefficient of the independent variables, CONF_BSI in two groups, model A and model B. For example as:

    (Model A) xtabond2 lev1_n l.lev1_n CONF_BSI tang_n MALSMCTG y2010-y2018 if manu_dummy==1, gmm (lev1_n,lag(3 4)collapse) gmm(l.tang_n l.CONF_BSI,collapse) iv(MALSMCTG, eq(diff)) iv(MALSMCTG,eq(level)) iv(y2010-y2018, eq(level)) robust h(2) twostep

    (Model B) xtabond2 lev1_n l.lev1_n CONF_BSI tang_n MALSMCTG y2010-y2018 if manu_dummy==0, gmm (lev1_n,lag(3 4)collapse) gmm(l.tang_n l.CONF_BSI,collapse) iv(MALSMCTG, eq(diff)) iv(MALSMCTG,eq(level)) iv(y2010-y2018, eq(level)) robust h(2) twostep

    I'd really appreciate it if anyone could give some suggestions on the command, if that possible.

    Thank you!

    Best regards

  • #2
    If you are trying to compare across the two models then you're after something like suest (see help suest). Unfortunately suest won't work in your case. You can replicate it's behavior by following this advice from Austin Nichols

    Comment


    • #3
      Hi Arthur,
      Thank you for your kind reply. Hopefully, the solution would be available in the future. Cheers!

      Comment


      • #4
        It is possible to use suest after xtdpdgmm (with option auxiliary), which is an alternative to xtabond2:
        https://www.kripfganz.de/stata/

        Comment


        • #5
          Thanks, Sebastian. Definitely I will give a try on that. Cheers!

          Comment


          • #6
            Originally posted by Sebastian Kripfganz View Post
            It is possible to use suest after xtdpdgmm (with option auxiliary), which is an alternative to xtabond2:
            Hi Sebastian Kripfganz ,

            I have attempted to employ the "xtdpdgmm+auxiliary" command to compare two coefficients in two regression models. The relevant code is outlined as follows:

            1: xtdpdgmm logrealagritotal L.logrealagritotal logimmishort logimmilong econdist exrate wgigap i.year if fta==0, model(diff) gmm(L.logrealagritotal logimmishort logimmilong) iv(econdist exrate wgigap i.year, model(diff)) vce(robust) twostep nocons auxiliary
            estimates store fta0

            2: xtdpdgmm logrealagritotal L.logrealagritotal logimmishort logimmilong econdist exrate wgigap i.year if fta==1, model(diff) gmm(L.logrealagritotal logimmishort logimmilong) iv(econdist exrate wgigap i.year, model(diff)) vce(robust) twostep nocons auxiliary

            estimates store fta1

            suest fta0 fta1

            test [fta0_mean = fta1_mean]: logimmilong

            However, I consistently encountered the error message "equation fta0 not found." Could you please provide some guidance on resolving this issue? Thank you in advance for your assistance.

            Comment


            • #7
              You would need to show us your suest output, which should indicate equation and coefficient names. I would expect the correct syntax for the test command to look like this:
              Code:
              test [fta0_logimmilong = fta1_logimmilong] : _cons
              (Note that in Stata 15 a change was introduced to the naming convention of the equations/parameters.)
              https://www.kripfganz.de/stata/

              Comment


              • #8
                Originally posted by Sebastian Kripfganz View Post
                You would need to show us your suest output, which should indicate equation and coefficient names. I would expect the correct syntax for the test command to look like this:
                Code:
                test [fta0_logimmilong = fta1_logimmilong] : _cons
                (Note that in Stata 15 a change was introduced to the naming convention of the equations/parameters.)
                The code is working perfectly; thank you. I have two additional questions, if you don't mind. Firstly, I'm comparing two commands, and even though they are meant to be similar, they produce different results ( I want to use sys GMM). I've reviewed related discussions on Statalist, but I'm still having difficulty understanding the discrepancy.

                1. xtdpdgmm logrealagritotal L.logrealagritotal logimmishort logimmilong econdist exrate wgigap i.year if fta==0, model(diff) gmm(L.logrealagritotal logimmishort logimmilong) iv(econdist exrate wgigap i.year, model(diff)) vce(robust) twostep nocons

                2. xtabond2 logrealagritotal L.logrealagritotal logimmishort logimmilong econdist exrate wgigap i.year if fta==0, gmm(L.(logrealagritotal) logimmishort logimmilong) iv(econdist exrate wgigap i.year, equation(diff)) robust h(2) nocons artests(3) twostep

                My second question pertains to the use of the "xtdpdgmm+estat serial" command. When reporting the results of the "Sargan-Hansen test," should I label it as "Sargan" or "Hansen"? I've noticed that in most research, it's reported as either "Sargan" or "Hansen."

                Once again, really appreciate your help.
                Last edited by Jane Quan; 29 Oct 2023, 08:02.

                Comment


                • #9
                  With xtabond2, you need to add the option noleveleq.
                  Furthermore, you either need to add the suboption passthru to the iv() option in xtabond2, or you need to add the suboption diff (in addition to model(diff)) to the iv() option in xtdpdgmm.
                  In some rare cases, you may also need to add the suboption mz to the iv() option in xtabond2.

                  After the two-step estimator, you would refer to the overidentification test result obtained with estat overid (not estat serial) as the Hansen test. After one-step difference GMM estimation, you might refer to the overidentification test (based on one-step residuals and weighting matrix) as the Sargan test.
                  https://www.kripfganz.de/stata/

                  Comment


                  • #10
                    Originally posted by Sebastian Kripfganz View Post
                    With xtabond2, you need to add the option noleveleq.
                    Furthermore, you either need to add the suboption passthru to the iv() option in xtabond2, or you need to add the suboption diff (in addition to model(diff)) to the iv() option in xtdpdgmm.
                    In some rare cases, you may also need to add the suboption mz to the iv() option in xtabond2.

                    After the two-step estimator, you would refer to the overidentification test result obtained with estat overid (not estat serial) as the Hansen test. After one-step difference GMM estimation, you might refer to the overidentification test (based on one-step residuals and weighting matrix) as the Sargan test.
                    Hi Dr. Kripfganz,

                    I have discovered that when using the Difference GMM method, the following two commands produce identical results:
                    -- xtdpdgmm logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, model(diff) gmm(L.logrealagritotal logimmi) iv(econdist exrate wgigap i.year, model(diff)) vce(robust) twostep nocons
                    -- xtabond2 logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, gmm(L.logrealagritotal logimmi) iv(econdist exrate wgigap i.year, passthru equation(diff)) robust h(2) nocons artests(3) twostep noleveleq


                    However, when applying the System GMM method, the following two commands produce different outcomes:
                    -- xtabond2 logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, gmm(L.logrealagritotal logimmi) iv(econdist exrate wgigap i.year, passthru equation(diff)) robust h(2) nocons artests(3) twostep

                    -- xtdpdgmm logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, model(level) gmm(L.logrealagritotal logimmi) iv(econdist exrate wgigap i.year, model(diff)) vce(robust) twostep nocons

                    I would like to confirm whether there might be an error in the commands or if there is another reason for the differing results. Thank you for your assistance.

                    Best regards,
                    Last edited by Jane Quan; 04 Nov 2023, 03:27.

                    Comment


                    • #11
                      I recommend to always explicitly specify the model() / equation() suboption, so that you get precisely what you ask for. The gmm() option for xtabond2() without the equation() suboption automatically creates instruments for both the level and the first-differenced model. That is not the case with xtdpdgmm.
                      https://www.kripfganz.de/stata/

                      Comment


                      • #12
                        Originally posted by Sebastian Kripfganz View Post
                        I recommend to always explicitly specify the model() / equation() suboption, so that you get precisely what you ask for. The gmm() option for xtabond2() without the equation() suboption automatically creates instruments for both the level and the first-differenced model. That is not the case with xtdpdgmm.
                        As you advised, I included the model()/equation() suboptions in both commands; however, the results remain identical in the Difference GMM but not in the System GMM.

                        * difference GMM: different commands and identical results
                        HTML Code:
                        -- xtabond2 logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, gmm(L.logrealagritotal logimmi, equation(diff)) iv(econdist exrate wgigap i.year, passthru equation(diff)) robust h(2) nocons artests(3) twostep noleveleq
                        
                        -- xtdpdgmm logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, model(diff) gmm(L.logrealagritotal logimmi, model(diff)) iv(econdist exrate wgigap i.year, model(diff)) vce(robust) twostep nocons
                        estat overid
                        estat serial
                        * system GMM: different commands and different results
                        HTML Code:
                        -- xtabond2 logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, gmm(L.logrealagritotal logimmi, equation(level)) iv(econdist exrate wgigap i.year, equation(level)) robust h(2) nocons artests(3) twostep
                        
                        -- xtdpdgmm logrealagritotal L.logrealagritotal logimmi econdist exrate wgigap i.year, model(level) gmm(L.logrealagritotal logimmi, model(level)) iv(econdist exrate wgigap i.year, model(level)) vce(robust) twostep nocons
                        Thank you
                        Best regards,
                        Last edited by Jane Quan; 04 Nov 2023, 22:35.

                        Comment


                        • #13
                          I should have mentioned in my previous post that the default settings for the lag() suboption are also different. Thus, I recommend to also specify this option explicitly for each command. Please see the respective help files for the defaults.

                          Side comment: What you are specifying is not actually a system GMM estimator but a level GMM estimator; there are no instruments specified for the first-differenced model anymore.
                          https://www.kripfganz.de/stata/

                          Comment

                          Working...
                          X