Announcement

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

  • An squared term is significant but the predicted probability is not U-shaped.

    I use Firth logistic regression to examine the following equations.

    Y= a +b1x+b2x2 (squared) but the predicted probability is not U - shaped (the first graph)



    Also, I have another equation: Y= c+dx+d2x2 (squared) but the coefficient (d) is negative and statistically significant but it is not inverted U-shaped (the second graph).

    I used the following command to calculate predicted probabilities.

    estimate store full
    margins, at ( duration_squared_c = (1 9)) atmeans expression(invlogit(predict(xb)))
    marginsplot


    Does anyone know why these are happening?
    Attached Files
    Last edited by April Kimm; 25 Jan 2022, 00:54.

  • #2
    The appropriate plot is against duration, not its square, but that's a detail. A quadratic being a fair fit doesn't mean that the turning point (minimum or maximum) will occur within the range of your data.

    Consider (1 + x)^2 = 1 + 2x + x^2 which has a minimum at -1. The minimum may not occur in the range of the data; that's empirical, not mathematical.

    The following sequence of graphs, which you can type directly regardless of data in Stata, makes the point. Naturally as the logit link involves a monotonic transformation the position of a turning point is unchanged by pushing a quadratic through invlogit().

    .
    Code:
      twoway function (1 + 2*x + x^2), ra(1 10)
    
    .  twoway function invlogit(1 + 2*x + x^2), ra(1 10)
    
    .  twoway function invlogit(1 + 2*x + x^2), ra(-10 10)

    Comment

    Working...
    X