Announcement

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

  • how to make xtdpdsys and xtabond2 equivalent?

    I am trying to receive the same results using xtdpdsys and xtabond2 unsuccessfully.
    Could you please guide me how to do it?

    Here is the xtdpdsys code that I try to replicate with xtabond2:
    xtdpdsys SR Prod Imp year*, vce(robust) end(UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn)
    xtdpdsys SR UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn Prod Imp year*, vce(robust)
    xtdpdsys SR Prod Imp year*, vce(robust) pre(UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn)


    Thank you.

  • #2
    The corresponding command syntax for xtabond2 is as follows:
    Code:
    xtabond2 L(0/1).SR UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn Prod Imp year*, gmm(SR UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn, lag(2 .)) iv(Prod Imp year*, eq(diff)) h(2) robust
    
    xtabond2 L(0/1).SR UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn Prod Imp year*, gmm(SR, lag(2 .)) iv(UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn Prod Imp year*, eq(diff)) h(2) robust
    
    xtabond2 L(0/1).SR UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn Prod Imp year*, gmm(SR, lag(2 .)) gmm(UTSO UDSO TPA MarkOpen IRA Bal price VTP Ex GRPd PubOwn, lag(1 .)) iv(Prod Imp year*, eq(diff)) h(2) robust
    https://twitter.com/Kripfganz

    Comment


    • #3
      Thank you, Sebastian, for your prompt reply and help. It works perfectly now and the results from both codes are the same.

      Comment


      • #4
        Hi, when I tried to used xtabond2 code following result is produced. Please show me the way to solve it.

        . xtabond2 L(0/1).GDPPCG GDPPCi0 GI UNEM INFL URBAN EDUCE HEALE shadow LFPART GDSPGDP INV PIT CIT GTGS GOVTS PIT_SA PIT_SHADOW PIT_SHADOW_SA CIT
        > _SA CIT_GLOB CIT_GLOB_SA GTGS_SA year1990- year2015, gmm(GDPPCG, lag(2 .)) gmm(GDPPCi0 GI UNEM INFL URBAN EDUCE HEALE shadow LFPART GDSPGDP INV
        > PIT CIT GTGS GOVTS PIT_SA PIT_SHADOW PIT_SHADOW_SA CIT_SA CIT_GLOB CIT_GLOB_SA GTGS_SA, lag(1 .)) iv(year1990- year2015, eq(diff)) h(2) robust
        Favoring space over speed. To switch, type or click on mata: mata set matafavor speed, perm.
        quadcross(): 3900 unable to allocate working space
        xtabond2_mata(): - function returned error
        <istmt>: - function returned error

        Comment


        • #5
          Hi All!, I use this code:

          xi: xtdpdsys pcAS z2 pre_mean alt lnC_m_r_f__o lnF_E_A_S lnFungicidas lnHerbicidas lnI_a_n lnMaterial_propagacion i_a_* , lags(1) pre(lagprecio lagOtros) artests(2) vce(robust) twostep
          note: pre_mean omitted from div() because of collinearity.
          note: alt omitted from div() because of collinearity.
          note: i_a_1 omitted from div() because of collinearity.
          note: i_a_1 omitted because of collinearity.
          note: i_a_5 omitted because of collinearity.

          System dynamic panel-data estimation Number of obs = 18,624
          Group variable: id Number of groups = 5,586
          Time variable: AÑO
          Obs per group:
          min = 1
          avg = 3.334049
          max = 5

          Number of instruments = 54 Wald chi2(16) = 2364.78
          Prob > chi2 = 0.0000
          Two-step results
          ----------------------------------------------------------------------------------------
          | WC-robust
          pcAS | Coefficient std. err. z P>|z| [95% conf. interval]
          -----------------------+----------------------------------------------------------------
          pcAS |
          L1. | .8552736 .0443983 19.26 0.000 .7682544 .9422927
          |
          lagprecio | .0002514 .0001079 2.33 0.020 .00004 .0004629
          lagOtros | -.0002913 .0000889 -3.28 0.001 -.0004657 -.000117
          z2 | .7151745 .3648443 1.96 0.050 .0000928 1.430256
          pre_mean | -.0137378 .0099912 -1.37 0.169 -.0333201 .0058446
          alt | -.002204 .0009387 -2.35 0.019 -.0040438 -.0003643
          lnC_m_r_f__o | -.3431311 .2760784 -1.24 0.214 -.8842348 .1979725
          lnF_E_A_S | .2523251 .298972 0.84 0.399 -.3336493 .8382994
          lnFungicidas | .8170511 .3499768 2.33 0.020 .1311091 1.502993
          lnHerbicidas | .1152862 .2551923 0.45 0.651 -.3848815 .6154539
          lnI_a_n | -.1575809 .3806501 -0.41 0.679 -.9036414 .5884795
          lnMaterial_propagacion | .0577852 .0796335 0.73 0.468 -.0982936 .213864
          i_a_2 | .522413 .1882741 2.77 0.006 .1534025 .8914235
          i_a_3 | .1684625 .1445746 1.17 0.244 -.1148984 .4518234
          i_a_4 | .3020224 .0866089 3.49 0.000 .1322722 .4717726
          i_a_6 | -.1024728 .0774617 -1.32 0.186 -.2542951 .0493494
          _cons | -.6070229 5.827687 -0.10 0.917 -12.02908 10.81503
          ----------------------------------------------------------------------------------------
          Instruments for differenced equation
          GMM-type: L(2/.).pcAS L(1/.).lagprecio L(1/.).lagOtros
          Standard: D.z2 D.lnC_m_r_f__o D.lnF_E_A_S D.lnFungicidas D.lnHerbicidas
          D.lnI_a_n D.lnMaterial_propagacion D.i_a_2 D.i_a_3 D.i_a_4 D.i_a_5
          D.i_a_6
          Instruments for level equation
          GMM-type: LD.pcAS D.lagprecio D.lagOtros
          Standard: _cons
          .



          But when I try to estimate the same regression with xtabond2, I don't get the same coefficients but these are similar.

          This is the code with xtabond2:
          xi: xtabond2 L(0/1).pcAS z2 lagprecio lagOtros pre_mean alt lnC_m_r_f__o lnF_E_A_S lnFungicidas lnHerbicidas lnI_a_n lnMaterial_propagacion i_a_2 i_a_3 i_a_4 i_a_6, gmm(l.pcAS lagprecio lagOtros, lag(1 .) ) iv(z2 lnC_m_r_f__o lnF_E_A_S lnFungicidas lnHerbicidas lnI_a_n lnMaterial_propagacion i_a_2 i_a_3 i_a_4 i_a_5 i_a_6, eq(diff) ) twostep robust h(2)

          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: id Number of obs = 18624
          Time variable : AÑO Number of groups = 5586
          Number of instruments = 54 Obs per group: min = 1
          Wald chi2(16) = 11004.57 avg = 3.33
          Prob > chi2 = 0.000 max = 5
          ----------------------------------------------------------------------------------------
          | Corrected
          pcAS | Coefficient std. err. z P>|z| [95% conf. interval]
          -----------------------+----------------------------------------------------------------
          pcAS |
          L1. | .8682682 .0389188 22.31 0.000 .7919888 .9445476
          |
          z2 | .751538 .3542788 2.12 0.034 .0571644 1.445912
          lagprecio | .0002435 .0001042 2.34 0.019 .0000393 .0004478
          lagOtros | -.0002373 .0000787 -3.02 0.003 -.0003915 -.0000832
          pre_mean | -.0122261 .0092467 -1.32 0.186 -.0303493 .005897
          alt | -.0017944 .0008031 -2.23 0.025 -.0033685 -.0002202
          lnC_m_r_f__o | -.1566321 .2695845 -0.58 0.561 -.685008 .3717439
          lnF_E_A_S | .3404469 .2604232 1.31 0.191 -.1699731 .8508669
          lnFungicidas | .8017626 .2731656 2.94 0.003 .2663678 1.337157
          lnHerbicidas | -.1259277 .2210927 -0.57 0.569 -.5592614 .3074059
          lnI_a_n | -.0983911 .3257134 -0.30 0.763 -.7367777 .5399954
          lnMaterial_propagacion | .0772578 .0650679 1.19 0.235 -.050273 .2047886
          i_a_2 | .523123 .1491537 3.51 0.000 .2307872 .8154588
          i_a_3 | .2013174 .1222973 1.65 0.100 -.038381 .4410157
          i_a_4 | .3628124 .0791912 4.58 0.000 .2076005 .5180243
          i_a_6 | -.0931929 .0733073 -1.27 0.204 -.2368725 .0504868
          _cons | -2.64894 4.559091 -0.58 0.561 -11.58459 6.286714
          ----------------------------------------------------------------------------------------
          Instruments for orthogonal deviations equation
          Standard
          FOD.(z2 lnC_m_r_f__o lnF_E_A_S lnFungicidas lnHerbicidas lnI_a_n
          lnMaterial_propagacion i_a_2 i_a_3 i_a_4 i_a_5 i_a_6)
          GMM-type (missing=0, separate instruments for each period unless collapsed)
          L(1/5).(L.pcAS lagprecio lagOtros)
          Instruments for levels equation
          Standard
          _cons
          GMM-type (missing=0, separate instruments for each period unless collapsed)
          D.(L.pcAS lagprecio lagOtros)

          Can someone explain to me why these differences happen, I will be very thankful.



          Comment


          • #6
            As far as I can see, the two specifications should be equivalent. You could double check the results with my xtdpdgmm command:
            Code:
            xtdpdgmm L(0/1).pcAS z2 lagprecio lagOtros pre_mean alt lnC_m_r_f__o lnF_E_A_S lnFungicidas lnHerbicidas lnI_a_n lnMaterial_propagacion i_a_*, gmm(L.pcAS lagprecio lagOtros, lag(1 .) m(diff)) gmm(L.pcAS lagprecio lagOtros, lag(0 0) diff m(level)) iv(z2 lnC_m_r_f__o lnF_E_A_S lnFungicidas lnHerbicidas lnI_a_n lnMaterial_propagacion i_a_*, diff m(diff)) twostep vce(robust) wmatrix(ind)
            Last edited by Sebastian Kripfganz; 08 May 2022, 02:35.
            https://twitter.com/Kripfganz

            Comment

            Working...
            X