Announcement

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

  • Margins postestimation command after xtabond2

    Hi Statalisters,

    I ran xtabond2 command to study the dynamic relationship between institutions and per capita carbon emissions and carbon intensity. The main difference between the two regressions below is the dependent variable. The dependent variable in the first regression is per capita carbon emissions, while in the second is the carbon intensity of energy use.

    Code:
    qui xtabond2 lpccarb L.lpccarb lrgdp c.lrgdp#c.lrgdp  lenguse lpopden indus period3-period31, gmm(L.(lpccarb) L.(lrgdp lrgdp2  lpopden lenguse indus), collapse lag(1 4) ortho) iv(i.year lenguse lpopden, equation(level)) robust twostep small ortho
    
    margins , dydx(lrgdp) at((p10) lrgdp) at((p25) lrgdp) at((p50) lrgdp) at((p75) lrgdp) at((p90) lrgdp)
    Warning: cannot perform check for estimable functions.
    
    Average marginal effects                        Number of obs     =      2,953
    Model VCE    : Corrected
    
    Expression   : Fitted Values, predict()
    dy/dx w.r.t. : lrgdp
    
    1._at        : lrgdp           =    7.722011 (p10)
    
    2._at        : lrgdp           =    8.404015 (p25)
    
    3._at        : lrgdp           =    9.261054 (p50)
    
    4._at        : lrgdp           =    10.13737 (p75)
    
    5._at        : lrgdp           =    10.63512 (p90)
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    lrgdp        |
             _at |
              1  |   .3619309   .1424492     2.54   0.011     .0827356    .6411262
              2  |   .2485135   .1102424     2.25   0.024     .0324425    .4645846
              3  |   .1059876   .0753118     1.41   0.159    -.0416209    .2535961
              4  |  -.0397445   .0579482    -0.69   0.493    -.1533208    .0738318
              5  |  -.1225195   .0631338    -1.94   0.052    -.2462595    .0012204
    ------------------------------------------------------------------------------
    Code:
    qui xtabond2 co2int L.co2int lrgdp lrgdp2 frleg frleg2 c.frleg#c.lrgdp lpopden indus  period3-period31, gmm(L.( co2int lrgdp lrgdp2 frleg c.frleg#c.frleg  lpopden indus), collapse lag(1 4) ortho ) iv( period3-period31  frleg frleg2  c.frleg#c.lrgdp  lpopden  , equation(level)) robust twostep small ortho
    
    margins , dydx(lrgdp) at((p10) lrgdp) at((p25) lrgdp) at((p50) lrgdp) at((p75) lrgdp) at((p90) lrgdp)
    Warning: cannot perform check for estimable functions.
    
    Average marginal effects                        Number of obs     =      2,944
    Model VCE    : Corrected
    
    Expression   : Fitted Values, predict()
    dy/dx w.r.t. : lrgdp
    
    1._at        : lrgdp           =    7.723423 (p10)
    
    2._at        : lrgdp           =    8.404617 (p25)
    
    3._at        : lrgdp           =     9.26136 (p50)
    
    4._at        : lrgdp           =    10.13833 (p75)
    
    5._at        : lrgdp           =    10.63704 (p90)
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    lrgdp        |
             _at |
              1  |   1.207137    .459612     2.63   0.009     .3063144     2.10796
              2  |   1.207137    .459612     2.63   0.009     .3063144     2.10796
              3  |   1.207137    .459612     2.63   0.009     .3063144     2.10796
              4  |   1.207137    .459612     2.63   0.009     .3063144     2.10796
              5  |   1.207137    .459612     2.63   0.009     .3063144     2.10796
    ------------------------------------------------------------------------------
    I use margins command to understand how the marginal effect of institutions affect the Environmental Kuznets Curve relationship or how the inclusion of institutions affects the impact of income on carbon emissions.
    When I ran margins command, I don't know why do I get same dy/dx for carbon intensity at different percentiles? However, that's not the case with per capita carbon emissions (see margins results from the first equation).

    #1. Am I running the wrong postestimation command?

    #2. Why is the marginal effect of institutions on EKC relationship same at different percentiles for carbon intensity?

    #3. Can someone also help me with the interpretation of margins command? I read that it's not a unit change but in fact a small change in x affecting y. Please correct me if I am wrong.

    Thank you.

    Ritika

  • #2
    Could it be that using lrgdp2 in the second model instead of c.lrgdp#c.lrgdp explains the observed differences?

    Since you are using xtabond2 with the orthogonal option, make sure that you are using the latest version of the command. For a discussion of problems in earlier versions, please see the following thread and the linked responses therein: https://www.statalist.org/forums/for...d-xtdpdsys-gmm
    https://www.kripfganz.de/stata/

    Comment


    • #3
      Sebastian Kripfganz

      Thank you, it worked.

      I will update my xtabond2 command once again.

      Comment


      • #4
        Hi experts and researchers,

        I am using interactive terms in my research and I need to understand how can I calculate marginal effect and standard errors after system GMM on STATA for Panel data?

        I am working on a Panel data model. I want to measure the marginal effect of the variable X1 on Y and represent it on a graph with STATA. Here is the equation: Y= a + b1X1 + b2X2 + b3X1*X2.

        I have found a paper that is similar to what I want to do. However, I still do not understand How the author has computed the marginal effect and standard error using these equations below using STATA Software and he also uses system GMM.

        yit = αyit−1 + β1FDit + β2INSit + β3Xit + ηi + εi

        the squared term is included in the model specification as follows:

        yit = αyit−1 + β1FDit + β2FD2it + β2INSit + β3Xit + ηi + εit

        this equation is extended to incorporate the interaction terms:

        yit = αyit−1 + β1FDit + β2FD2it + β3INSit + β4(FDxINS)it + β5(FD2xINS)it + β4Xit + ηi + εit ... Eq. (4)

        the margin effect for Eq. (4), the total effect of increasing y due to FD can be calculated

        by examining the partial derivative of y, as follows:

        ∂yit/∂FDit = β1 + 2β2FD + β4INS + 2β5FD x INS ... Eq. (5)

        he computes the standard error in the case in which the
        model is Eq. (4), the marginal effect is equal to Eq. (5). Using the covariance matrix, the variance (i.e., standard error) is computed as:

        σ^2 ∂y/∂x= var(βˆ1) + 4FD2var(βˆ2) + INS2var(βˆ4) + 4FD2INS2var(βˆ5) + 4FDcov(βˆ1βˆ2) +2INScov(βˆ1βˆ4) + 4FDINScov(βˆ2βˆ4) + 4FDINScov(βˆ1βˆ5) + 8FD2INScov(βˆ2βˆ5) +4FDINS2cov(βˆ4βˆ5)

        How can I get marginal effect results as he has done in the table below using Stata? What is the command? see pictures, please

        I would be very grateful for any help

        Many Thanks
        Badiah
        Click image for larger version

Name:	table 1.png
Views:	2
Size:	86.2 KB
ID:	1627367


        Click image for larger version

Name:	marginal effect.png
Views:	2
Size:	155.5 KB
ID:	1627366

        Comment

        Working...
        X