Announcement

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

  • Determining the turning point on a twoway qfit graph

    Hi,

    In Stata I'm trying to determine the relationship between inequality and growth, as part of this I'm trying to replicate the Kuznets U-shaped curve (plotting log GDP per capita against Gini).

    I have used the commnad:

    tw (qfit gini_net lngdp_pc) (sc gini_net lngdp_pc)

    As part of my analysis, in-line with most of the surrounding literature, I would like to determine the turning point of the curve shown below.

    Click image for larger version

Name:	Graph.png
Views:	1
Size:	21.7 KB
ID:	1377781


    Any help on this would be much appreciated.

    Thanks in advance,
    Ben

  • #2
    I think you need to do the regression using regress and then apply the usual method based on the coefficients of the quadratic. twoway qfit doesn't leave the coefficients in memory.

    You seem to have unusual units if some log GDP per capita are negative, i.e. some GDP per capita are less than 1.

    Comment


    • #3
      Thanks for the quick response.

      Yes I do have some GDP per capita values that are less than 1 (e.g. El Salvador in 1970=0.837). Would you recommend adapting the GDP per capita values so they are all above 1?

      So I've used the command:

      reg gini_net lngdp_pc_2

      gini_net=Gini Coefficient, lngdp_pc_2=log(gdp per capita)^2

      I'm not sure from these results how to get a value for the turning point. Would it be through the margins and marginsplot commands?

      Thanks,
      Ben

      Comment


      • #4
        I would recommend being explicit about the unit of measurement, which is not obvious. That's just important for your presentation elsewhere, or so I imagine. There is no magic about the value being above or below 1, so long as the units make sense.

        On your question, I imagine that this is standard stuff in one of your texts. You need a regression on both the linear and the squared term. Then generically if you have a quadratic

        a + bx + cx^2

        a turning point is when the first derivative b + 2cx is zero or x = -b / 2c. In general, you need to check, empirically or otherwise, whether the turning point is a minimum or maximum, and also within the observed range of your data, but it is obvious in your case.

        This is an example you can run:

        Code:
        webuse nlswork
        twoway qfit ln_wage age
        gen agesq = age^2
        regress ln_wage age agesq
        
        
              Source |       SS           df       MS      Number of obs   =    28,510
        -------------+----------------------------------   F(2, 28507)     =   1379.28
               Model |  574.966399         2    287.4832   Prob > F        =    0.0000
            Residual |  5941.72375    28,507  .208430342   R-squared       =    0.0882
        -------------+----------------------------------   Adj R-squared   =    0.0882
               Total |  6516.69015    28,509  .228583611   Root MSE        =    .45654
        
        ------------------------------------------------------------------------------
             ln_wage |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   .0855891   .0035923    23.83   0.000     .0785481    .0926302
               agesq |  -.0010982   .0000596   -18.42   0.000    -.0012151   -.0009814
               _cons |   .1647917   .0521021     3.16   0.002      .062669    .2669143
        ------------------------------------------------------------------------------
        
        di -_b[age]/(2 * _b[agesq])
        38.966843
        
        local tp = -_b[age]/(2 * _b[agesq])
        
        twoway qfit ln_wage age, xli(`tp')
        All the commands once more:

        Code:
        webuse nlswork
        twoway qfit ln_wage age
        gen agesq = age^2
        regress ln_wage age agesq
        di -_b[age]/(2 * _b[agesq])
        local tp = -_b[age]/(2 * _b[agesq])
        twoway qfit ln_wage age, xli(`tp')

        Comment


        • #5
          Perfect.

          The code works and I know have the turning point for the curve.

          Thanks for all the help,
          Ben

          Comment


          • #6
            Hello,

            I am doing my bachelor's thesis and I have encountered the same problem in finding the turning point of my EKC. I employed trade openness and trade openness squared as my main explanatory variables against CO2 emission as the measure of environmental quality. My results showed that TO is negative while the TO2 denotes a positive sign, As I have learned from various literature, based on those signs of the coefficients, I can imply that my model portrays a U-shaped curve. This is where the difficulty enters. I want to generate a U-shaped curve in Stata and I do not know the appropriate commands to use. I've tried the commands suggested in this thread, but it shows an inverted U-shaped curve.

            I would appreciate all of your insights/responses regarding this. Thanks in advance!

            Regards,
            Justine
            Last edited by Justine Borja; 04 Nov 2021, 10:25.

            Comment


            • #7
              It should be an inverted U shape
              ---------------------------------
              Maarten L. Buis
              University of Konstanz
              Department of history and sociology
              box 40
              78457 Konstanz
              Germany
              http://www.maartenbuis.nl
              ---------------------------------

              Comment


              • #8
                Hello Sir Maarten! Apologies as I've interchanged the signs of TO and TO^2. My TO is a negative coefficient while my TO2 is a positive coefficient. So it's a U-shaped curve, not really inverted U. Do you have any idea on the commands to use in Stata regarding this?

                Thanks,
                Justine
                Last edited by Justine Borja; 04 Nov 2021, 10:29.

                Comment


                • #9
                  People interested in #6 #7 #8 please follow to https://www.statalist.org/forums/for...erting-wrongly

                  Comment


                  • #10
                    Apologies Sir Nick as I'm still learning the environment here. I'll be better next time. Thanks!

                    Comment

                    Working...
                    X