Announcement

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

  • Quadratic term when the level variable has both positive and negative values

    Hi All,

    We are estimating a regression of Y on X where X takes both positive and negative values. To account for nonlinearities in the relationship, we include X-squared as right hand side variable. By construction X-squared will have only positive values. My dilema is whether this changes the type of the relationship between Y and X we are trying to model?

    Best regards,
    Bersant

  • #2
    Well, let's see . . .
    Code:
    version 15.0
    
    clear *
    set seed 1410833
    quietly set obs 25
    generate double x = runiform() - 0.5
    generate double y = x + x * x + rnormal()
    
    summarize x, meanonly
    generate double x_pos = x - r(min) + 1
    
    graph twoway qfit y x || qfit y x_pos
    
    exit
    Last edited by Joseph Coveney; 17 Sep 2017, 21:02.

    Comment


    • #3
      I don't understand the question. Clearly you can fit a quadratic or a linear term alone regardless of the sign of the predictor. As Joseph implies, you need to plot the data and the fit to see whether the quadratic is a good idea.

      Comment


      • #4
        The fact that X takes both positive and negative values does not justify the use of quadratic specification. I doubt that bhobdari mis-understand the ideas of linear vs quadratic specifications.
        Ho-Chuan (River) Huang
        Stata 19.0, MP(4)

        Comment


        • #5
          River: I see no problem in principle in fitting a quadratic here. Much depends on the definition of the x variable and whether y should behave smoothly for negative, zero and positive x.

          Comment


          • #6
            Rather then it being a problem, it can actually be desirable to change X such that it has both negative and positive numbers. Take year of birth, which typically takes quite high values (1976 to take a not very random example). If you take squares of those fairly large numbers, then x and its square will be near perfectly correlated. Say our year of birth variable ranges from 1950 to 2000, then you will get twoway function y = x^2, range(1950 2000). The correlation will be so strong that it may cause problems estimating the individual effects of x and x squared. We could (and should) center our variable at something like 1975, then the new x and its square will be almost uncorrelated (twoway function y = x^2, range(-25 25)), and their separate effects will be much easier to estimate.
            ---------------------------------
            Maarten L. Buis
            University of Konstanz
            Department of history and sociology
            box 40
            78457 Konstanz
            Germany
            http://www.maartenbuis.nl
            ---------------------------------

            Comment


            • #7
              Maarten's point is taken in various directions within

              Code:
              SJ-15-2 st0394  . . . . . . . . . . . . . .  Speaking Stata: Species of origin
                      . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
                      Q2/15   SJ 15(2):574--587                                (no commands)
                      explores origins (some fixed and natural, others just
                      conventional and sometimes not even convenient) and considers
                      how best to model simple trends and seasonal periodicities as
                      well as defining noncalendar years

              Comment


              • #8
                Thank you all for the input provided so far. I should have been more clear what I am modeling as my concern is more conceptual than statistical. I am modeling Cummulative Abnormal Returns (CARs) as a function of changes in size of blockholding by several groups (families, banks, mutual funds). Over time blockholding increases or decreases, leading to X variable take both positive and negative values. When taking the square of X the negative values become positive. So, I am concerned of two things: (1) whether the relationship I am modeling is still the same, and (2) whether this implies anything about statistical significance (the coefficient of X-squared is insignificant although the scatter plot of Y on X is by far strictly linear).

                Comment


                • #9
                  Originally posted by bhobdari View Post
                  (1) whether the relationship I am modeling is still the same
                  The sign of an effect is not the same as the sign of a variable. If you add a square of a variable \(x\), then the sign of the coefficient of \(x\) will tell you the direction of the effect when \(x\) is 0. The sign of the coefficient of \x^2\) tells you whether that effect increases or decreases as \(x\) increases. For example, when the coefficient of \(x\) is positive, then \(y\) will increase when \(x\) increases when \(x\) is 0. When the coefficient of \(x^2\) is negative, then the effect of \(x\) will decrease when \(x\) increases, and eventually that effect will become negative. So in this case the effect will be concave. So it is irrelevant for the direction of the effect that squaring turns all values of the variable positive.

                  Originally posted by bhobdari View Post
                  (2) whether this implies anything about statistical significance (the coefficient of X-squared is insignificant although the scatter plot of Y on X is by far strictly linear).
                  Again this has nothing to do with the sign of the values on the squared term. A quadratic is not the only way in which a relationship can be non-linear, so it is perfectly possible for a relationship to be non-linear and the quadratic term to add nothing to the model. You may want to look at help fp
                  ---------------------------------
                  Maarten L. Buis
                  University of Konstanz
                  Department of history and sociology
                  box 40
                  78457 Konstanz
                  Germany
                  http://www.maartenbuis.nl
                  ---------------------------------

                  Comment


                  • #10
                    Thank you Maarten for the thoughtful response and the suggestion to look at fp.

                    Comment

                    Working...
                    X