Announcement

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

  • Interact a dummy against its own continuous

    I find that it is very hard to interpret quadratic parameters.

    When I can see an inflection point in the scatter plot, does it make any sense at all to create a dummy variable such that higher than inflection x's are 1, and lower are 0 and then to interact that with the continuous?

    e.g. say i have income in $ and age in days
    maybe i can see in scatter plot that the income age chart inflects at around 50 years of age (18250 days).
    Code:
    gen age_high = 0
    replace age_high = 1 if age > 18250
    Does it make any sense, and is it even possible to run a model:
    Code:
    reg income age##age_high
    Last edited by Pratap Pundir; 17 Nov 2021, 05:50.
    Thank you for your help!

    Stata SE/17.0, Windows 10 Enterprise

  • #2
    I suspect that what you are looking for is a linear spline. See help mkspline
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Yes, thanks! I think I AM basically looking for a piecewise technique.
      Thank you for your help!

      Stata SE/17.0, Windows 10 Enterprise

      Comment

      Working...
      X