Announcement

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

  • Calculating turning point for moderated quadratic effects

    Dear Forumgoers,
    I have a mixed effects model in which individuals (designated by "id") are measured on X and Y five days in a row which includes a quadratic term for X. I am interested in calculating the X value for the turning point at each of the five day values. The model includes random intercepts and slopes.
    I was able to calculate the turning point for the initial model before adding the interaction term as follows:

    Code:
     mixed y c.x##c.x i.day || id: c.x
     nlcom -_b[c.x]/(2*_b[c.x#c.x])
    However, I am not sure how to adjust this code to get the predicted turning points for each value of "day" (which ranges 1 to 5) when I add the interaction as follows.
    Code:
     mixed y c.x##c.x##i.day || id: c.x
    It seems like I can adjust the nlcom prediction, but I am unsure how. Can anyone clarify?

    Thanks,
    Matt

  • #2
    Not tested, so beware of typos, unbalanced or misplaced parentheses, etc.:

    Code:
    forvalues d = 1/5 {
        nlcom -(_b[c.x]+_b[`d'.day#c.x])/(2*(_b[c.x#c.x]+_b[`d'.day#c.x#c.x]))
    }

    Comment


    • #3
      Thanks Clyde--this worked perfectly and I see exactly how it works. Your help is much appreciated.

      Comment

      Working...
      X