Announcement

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

  • Find turning points

    Dear all,

    for my current work, I need to display turning points of my quadratic function. My dependent var Y depends on X, X2 , G and the interaction term X*G
    Y= a1X2 + a2X + a3G + a4G*X

    For this function, I need to calculate the turning point (Vertex). I am aware of the formula where the turning point for y = ax2 + bx + c is at x = -b/2a. However, I still don't know how/whether to include the coefficient for the interaction term and how to deal with two explanatory variables, nor do I know how to smartly calculate the turning points in Stata. Maybe the "margins" command can be helpful?
    I would appreciate any help, in explaining the rationales and also hints for my state code.

    I did not provide any details about my dataset because I think it should not be relevant. If I am mistaken here, please let me know. I use Stat 16.
    Many thanks in advance
    Lars

  • #2
    What is G? If G is a binary variable, say with values {0, 1}, then that defines two points, if I understand correctly; otherwise I think the turning point is a ridge within the space of those variables. Otherwise put, you are there in 3-dimensional space.

    Comment


    • #3
      Thank you for the quick answer. G is numeric with a range from 0 to 1.
      The three-dimensional space seems inappropriate than. My thoughts are treating G as a simple control variable. Still, I am unsure about how to deal with the interaction term.

      Comment


      • #4
        A binary variable is a numeric variable, but not all numeric variables are binary. So you have still not answered Nick's question. Does G take only the values 0 or 1 (and maybe missing) or can it also take values like 0.1, 0.2, 0.3333, etc.?
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Here is an example with a binary G:

          Code:
          sysuse nlsw88, clear
          reg wage c.tenure##c.tenure i.south i.south#c.tenure
          margins , at(south=(0/1)) ///
             expression(-(_b[tenure]+_b[1.south#c.tenure]*1.south)/(2*_b[c.tenure#c.tenure]))
          ---------------------------------
          Maarten L. Buis
          University of Konstanz
          Department of history and sociology
          box 40
          78457 Konstanz
          Germany
          http://www.maartenbuis.nl
          ---------------------------------

          Comment


          • #6
            Thank you for the response Maarten, I am not too familiar with the terms, excuse me. Your latter suggestion was right, it can take values like 0.1; 0.5 etc.
            Could you indicate an example with a non-binary G please?

            Comment

            Working...
            X