Announcement

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

  • Restricted cubic splines with log-transformed regressor?

    Dears,

    I'm using a restricted cubic spline regression to estimate the effect of one continuous variable on a binary outcome with the command:
    mkspline2 exxx = exemp1, cubic displayknots
    And then I plot the predictive margins and marginal effects using adjustrcspline and mfxrcspline.
    So, I use the 5 default knots that are placed at equally spaced percentiles of the regressor's distribution (according to the Stata manual). My question is, can I use the spline with log(exemp1))?
    I'm only finding an effect at low values of the regressor, which in addition accumulate most of the observations in my sample. With a log transformed variable I'll be able to visualize those effects much better, but I wonder if it is correct to combine it with the spline regression.
    Thanks a lot for any clarification about this.

    Mariela
    Last edited by Mariela Dal Borgo; 11 Jul 2014, 10:19.

  • #2
    These are separate tricks and are compatible. In practice, you log transform your regressor to create a new variable, and then define cubic spline variables in terms of that.

    Note that all the program names you use here are of user-written programs, so you are asked to explain their provenance. Please read the FAQ advice again to understand this.

    Comment


    • #3
      Thanks a lot, yes, I guess that's what I'll do since the regressor is a bit skewed, I wanted to confirm that they are compatible and I'm not abusing of the transformations.
      Sorry for missing the reference of the programs, they are explained in detail in Maarten Buis' notes: http://maartenbuis.nl/presentations/bonn09.pdf

      Thanks again!

      Mariela

      Comment

      Working...
      X