Announcement

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

  • Turning point for quadratic and interaction terms

    Hi,

    I used dynamic panel estimation model - GMM to examine the relationship between institutions and carbon emissions. I have used a quadratic term and interaction term in the same equation. I want to know how to find the turning point when there is a linear, quadratic term and interaction term in an equation.

    I ran the following command:

    Variables of interest:

    frleg: Institutions
    i.inclevel: categorical variable with 4 different income levels. High-income level countries is the base category.

    Code:
     xtabond2 co2int L.co2int i.inclevel frleg frleg2 c.frleg#i.inclevel lpopden indus  period3-period31, gmm(L.(co2int frleg frleg2 c.frleg#i.inclevel  lpopden  indus), collapse lag(1 4) ortho) iv(period3-period31  c.frleg#i.inclevel frleg2 frleg, equation(level)) robust twostep small ortho
    In the output below, I have removed periods to condense the table.
    Code:
    .  
    
    Dynamic panel-data estimation, two-step system GMM
    ------------------------------------------------------------------------------
    Group variable: cty                             Number of obs      =      2937
    Time variable : year                            Number of groups   =       121
    Number of instruments = 75                      Obs per group: min =         3
    F(42, 120)    =     32.71                                      avg =     24.27
    Prob > F      =     0.000                                      max =        30
    --------------------------------------------------------------------------------------
                         |              Corrected
                  co2int |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------------+----------------------------------------------------------------
                  co2int |
                     L1. |   .6831759   .0431564    15.83   0.000     .5977293    .7686226
                         |
                inclevel |
      high-income, OECD  |          0  (empty)
             low-income  |   2.143515   .9536475     2.25   0.026     .2553593    4.031671
    lower-middle-income  |   1.462294   .7817783     1.87   0.064    -.0855731     3.01016
    upper-middle-income  |    1.53233   .6849764     2.24   0.027     .1761243    2.888536
                         |
                   frleg |     7.7978   3.146071     2.48   0.015     1.568798     14.0268
                  frleg2 |  -4.561939      1.862    -2.45   0.016    -8.248569   -.8753081
                         |
        inclevel#c.frleg |
      high-income, OECD  |          0  (empty)
             low-income  |  -3.563873   1.382582    -2.58   0.011    -6.301289   -.8264566
    lower-middle-income  |  -1.873472    1.08048    -1.73   0.085    -4.012747    .2658019
    upper-middle-income  |  -1.923528   .9477975    -2.03   0.045    -3.800101   -.0469549
                         |
                 lpopden |   .0289588   .0539836     0.54   0.593     -.077925    .1358426
                   indus |   .0023753   .0034381     0.69   0.491    -.0044318    .0091824
                 
                   _cons |  -2.699571   1.347477    -2.00   0.047    -5.367482   -.0316595
    --------------------------------------------------------------------------------------
    Instruments for orthogonal deviations equation
      GMM-type (missing=0, separate instruments for each period unless collapsed)
        BOD.L(1/4).(L.co2int L.frleg L.frleg2 1bL.inclevel#coL.frleg
        3L.inclevel#cL.frleg 4L.inclevel#cL.frleg 5L.inclevel#cL.frleg L.lpopden
        L.indus) collapsed
    Instruments for levels equation
      Standard
        period3 period4 period5 period6 period7 period8 period9 period10 period11
        period12 period13 period14 period15 period16 period17 period18 period19
        period20 period21 period22 period23 period24 period25 period26 period27
        period28 period29 period30 period31 1b.inclevel#co.frleg
        3.inclevel#c.frleg 4.inclevel#c.frleg 5.inclevel#c.frleg frleg2 frleg
        _cons
      GMM-type (missing=0, separate instruments for each period unless collapsed)
        D.(L.co2int L.frleg L.frleg2 1bL.inclevel#coL.frleg 3L.inclevel#cL.frleg
        4L.inclevel#cL.frleg 5L.inclevel#cL.frleg L.lpopden L.indus) collapsed
    ------------------------------------------------------------------------------
    Arellano-Bond test for AR(1) in first differences: z =  -4.76  Pr > z =  0.000
    Arellano-Bond test for AR(2) in first differences: z =  -0.32  Pr > z =  0.750
    ------------------------------------------------------------------------------
    Sargan test of overid. restrictions: chi2(32)   =  79.01  Prob > chi2 =  0.000
      (Not robust, but not weakened by many instruments.)
    Hansen test of overid. restrictions: chi2(32)   =  40.32  Prob > chi2 =  0.148
      (Robust, but weakened by many instruments.)
    
    Difference-in-Hansen tests of exogeneity of instrument subsets:
      GMM instruments for levels
        Hansen test excluding group:     chi2(24)   =  36.88  Prob > chi2 =  0.045
        Difference (null H = exogenous): chi2(8)    =   3.44  Prob > chi2 =  0.904
    My question is:
    1# How to estimate the turning point for institutions (frleg) with respect to each income-level of countries? i.e. turning point for low, middle or upper-middle income countries.

    I know if there were no interaction term in this regression, then using the formula b/|2a| would have worked. But, how do I estimate with respect to each income group category?

    Can someone please help me with me?

    Thank you.

    Ritika

  • #2
    In general, for the equation y = a + b1x + b2x2 + other stuff, the turning point is when the derivative of y with respect to x is zero, so b1 = 2b2x and thus x = b1/2b2 . In your case, then, x is frleg.

    By adding the interaction term of the catgorical variable inclevel with the continuous variable frleg - but not with the squared term frleg2 - your equation is now y = a + b1x + b1,ix + b2x2 where you have separate values of b1,i for the three categories. You now have three derivatives - depending on the value of inclevel - b1 + b1,i + b2x2. In your case, for example, x is again frieg and i is inclevel.

    With that said, I find your formulation of your model - with an interaction on the linear term but not the quadratic - unconvincing, and your manual calculation of the squared term concerning. On the other hand, I'm not familiar with the requirements of xtabond2.

    If I were fitting a simple regression model, I would follow the guidance of help factor variables and replace
    Code:
    i.inclevel frleg frleg2 c.frleg#i.inclevel
    with
    Code:
    i.inclevel##(c.frleg##c.frleg)
    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . reg price foreign##(c.weight##c.weight)
    
          Source |       SS           df       MS      Number of obs   =        74
    -------------+----------------------------------   F(5, 68)        =     26.58
           Model |   420102093         5  84020418.6   Prob > F        =    0.0000
        Residual |   214963303        68  3161225.05   R-squared       =    0.6615
    -------------+----------------------------------   Adj R-squared   =    0.6366
           Total |   635065396        73  8699525.97   Root MSE        =      1778
    
    -------------------------------------------------------------------------------------------
                        price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    --------------------------+----------------------------------------------------------------
                      foreign |
                     Foreign  |  -7591.759   12655.18    -0.60   0.551    -32844.77    17661.25
                       weight |  -9.841423   2.584497    -3.81   0.000    -14.99871   -4.684139
                              |
            c.weight#c.weight |   .0019851   .0003958     5.01   0.000     .0011952    .0027749
                              |
             foreign#c.weight |
                     Foreign  |   3.464758    9.99671     0.35   0.730    -16.48337    23.41288
                              |
    foreign#c.weight#c.weight |
                     Foreign  |   .0003262   .0019341     0.17   0.867    -.0035333    .0041858
                              |
                        _cons |   15933.98   4129.479     3.86   0.000     7693.739    24174.23
    -------------------------------------------------------------------------------------------

    Comment


    • #3
      while I agree with what William Lisowski writes, I see a small typo in the first line of this answer; it should be -b1/2b2 (i.e., he left out a negative sign at the beginning)

      Comment


      • #4
        Rich Goldstein is correct, my first sentence should have read
        In general, for the equation y = a + b1x + b2x2 + other stuff, the turning point is when the derivative of y with respect to x is zero, so 0 = b1 + 2b2x and thus x = -b1/2b2 .

        Comment


        • #5
          To add to William Lisowski's comment, you should check that the turning point occurs at a reasonable value for the dependent variable. To take another example, if the turning point occurs at age = 120 or number of years of education =40.
          But even in this case the quadratic term is useful to know whether the marginal effect is increasing or decreasing. Here you will need the second derivative.

          Comment


          • #6
            Thank you William Lisowski Rich Goldstein and Eric de Souza for providing feedback on my post. You're right! I haven't added a interaction-quadratic term for income level (inclevel). Please see the equation now and let me know if you think it still needs correction.

            Code:
            xtabond2 co2int L.co2int i.inclevel frleg i.inclevel##(c.frleg#c.frleg) lpopden indus  period3-period31, gmm(L.(co2int frleg frleg2 c.frleg#i.inclevel  lpopden  indus), collapse lag(1 4) ortho) iv(period3-period31 frleg2 frleg, equation(level)) robust twostep small ortho
            Code:
            Dynamic panel-data estimation, two-step system GMM
            ------------------------------------------------------------------------------
            Group variable: cty                             Number of obs      =      2937
            Time variable : year                            Number of groups   =       121
            Number of instruments = 72                      Obs per group: min =         3
            F(42, 120)    =     24.43                                      avg =     24.27
            Prob > F      =     0.000                                      max =        30
            ------------------------------------------------------------------------------------------
                                     |              Corrected
                              co2int |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------------------+----------------------------------------------------------------
                              co2int |
                                 L1. |   .6780733   .0480761    14.10   0.000     .5828859    .7732606
                                     |
                            inclevel |
                  high-income, OECD  |          0  (empty)
                         low-income  |   1.060204   .5851721     1.81   0.073     -.098396    2.218804
                lower-middle-income  |   .8211656   .3934477     2.09   0.039     .0421666    1.600165
                upper-middle-income  |   .9322376   .3685227     2.53   0.013     .2025882    1.661887
                                     |
                               frleg |   5.524321   2.639924     2.09   0.038     .2974549    10.75119
                                     |
                     c.frleg#c.frleg |  -2.998079   1.578777    -1.90   0.060    -6.123947    .1277891
                                     |
            inclevel#c.frleg#c.frleg |
                  high-income, OECD  |          0  (empty)
                         low-income  |  -2.931157   1.254132    -2.34   0.021    -5.414252   -.4480624
                lower-middle-income  |  -1.318261   .7803076    -1.69   0.094    -2.863216    .2266937
                upper-middle-income  |  -1.475626   .6378332    -2.31   0.022    -2.738491   -.2127608
                                     |
                             lpopden |   .0312555   .0475772     0.66   0.512    -.0629441    .1254551
                               indus |   .0012097    .004076     0.30   0.767    -.0068605    .0092799
            
                               _cons |  -1.878872   1.072852    -1.75   0.082    -4.003045    .2453006
            ------------------------------------------------------------------------------------------
            Instruments for orthogonal deviations equation
              GMM-type (missing=0, separate instruments for each period unless collapsed)
                BOD.L(1/4).(L.co2int L.frleg L.frleg2 1bL.inclevel#coL.frleg
                3L.inclevel#cL.frleg 4L.inclevel#cL.frleg 5L.inclevel#cL.frleg L.lpopden
                L.indus) collapsed
            Instruments for levels equation
              Standard
                period3 period4 period5 period6 period7 period8 period9 period10 period11
                period12 period13 period14 period15 period16 period17 period18 period19
                period20 period21 period22 period23 period24 period25 period26 period27
                period28 period29 period30 period31 frleg2 frleg
                _cons
              GMM-type (missing=0, separate instruments for each period unless collapsed)
                D.(L.co2int L.frleg L.frleg2 1bL.inclevel#coL.frleg 3L.inclevel#cL.frleg
                4L.inclevel#cL.frleg 5L.inclevel#cL.frleg L.lpopden L.indus) collapsed
            ------------------------------------------------------------------------------
            Arellano-Bond test for AR(1) in first differences: z =  -4.55  Pr > z =  0.000
            Arellano-Bond test for AR(2) in first differences: z =  -0.33  Pr > z =  0.739
            ------------------------------------------------------------------------------
            Sargan test of overid. restrictions: chi2(29)   =  60.76  Prob > chi2 =  0.000
              (Not robust, but not weakened by many instruments.)
            Hansen test of overid. restrictions: chi2(29)   =  36.93  Prob > chi2 =  0.148
              (Robust, but weakened by many instruments.)
            
            Difference-in-Hansen tests of exogeneity of instrument subsets:
              GMM instruments for levels
                Hansen test excluding group:     chi2(21)   =  25.56  Prob > chi2 =  0.224
                Difference (null H = exogenous): chi2(8)    =  11.37  Prob > chi2 =  0.182
            Note: removed periods to save space.

            Based on the explanation provided in comment #2, I have estimated turning for low-income countries. Please correct me if I am wrong.

            Just focusing on the variables of interest. Now the equation for low-income countries would be as follows:

            Y = 5.552frleg -2.99frleg2 - 2.93low*frleg2

            Taking derivative of the above equation w.r.t frleg and setting it equal to 0.

            dY/frleg = 5.52 - 2*2.99*frleg - 2*2.93*low = 0

            Assuming the mean value of institutions of low-income countries is 0.508.

            frleg = 0.616 is the turning point for low-income countries.
            Last edited by Ritika Khurana; 03 Nov 2020, 13:01. Reason: fixing a typo.

            Comment


            • #7
              Now you have inclevel#c.frleg#c.frleg but you no longer have inclevel#c.frleg. In post #6

              Code:
              ... i.inclevel frleg i.inclevel##(c.frleg#c.frleg) ...
              should instead be
              Code:
              ... i.inclevel##(c.frleg##c.frleg) ...
              as suggested in post #2, which will give you the coefficients for the inclevel indicators, the coefficients for frleg and frleg2, and the coefficients for the interactions between inclevel and frleg and between inclevel and frleg2.
              Last edited by William Lisowski; 03 Nov 2020, 20:16.

              Comment


              • #8
                William Lisowski thnak you for correcting me again. this works now!

                Comment


                • #9
                  William Lisowski Thank you for correcting me again. this works now!

                  Comment

                  Working...
                  X