Announcement

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

  • Fractional polynomials in logistic regression

    Dear STATALIST community,

    Hi,

    I am trying to plot secular trends using fractional polynomials. I would like to identify a set of fractional polynomials of the variable named "year5" using the fp command.
    THe outcome entitled "explain2" is an indicator variable, 0 vs. 1 (yes).
    The issue I'm experiencing is that the fp command does not generate the p values, which should be able to tell me whether having one or more fractional polynomial terms significantly reduces the deviance statistic.
    I wanted to see if anybody could tell me why it doesn't generate the p-values in my case.
    I also wanted to see if there are ways to say that a set of fractional polynomials are "significantly better" than the others based on the given deviance statistics.

    Thank you in advance!





    . fp <year5>, powers (-2 -1 -0.5 0 0.5 1 2 3) dimension(3): logit explain2 <year5> [pweight=saqwt]
    (fitting 164 models)
    (....10%....20%....30%....40%....50%....60%....70% ....80%....90%....100%)

    Fractional polynomial comparisons:
    --------------------------------------------------------------------
    year5 | df Deviance Dev. dif. P(*) Powers
    -------------+------------------------------------------------------
    omitted | 0 2.971e+09 7236985 --
    linear | 1 2.965e+09 1348577 -- 1
    m = 1 | 2 2.964e+09 298505 -- 3
    m = 2 | 4 2.964e+09 241690 -- 3 3
    m = 3 | 6 2.964e+09 0 -- -2 -1 -.5
    --------------------------------------------------------------------
    (*) deviance difference test not valid with robust variance estimation

    Logistic regression Number of obs = 198,962
    Wald chi2(3) = 398.37
    Prob > chi2 = 0.0000
    Log pseudolikelihood = -1.482e+09 Pseudo R2 = 0.0024

    ------------------------------------------------------------------------------
    | Robust
    explain2 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    year5_1 | -6.831685 .7743655 -8.82 0.000 -8.349413 -5.313956
    year5_2 | 23.15228 2.420883 9.56 0.000 18.40744 27.89713
    year5_3 | -22.23864 2.18047 -10.20 0.000 -26.51228 -17.96499
    _cons | 6.292316 .5311706 11.85 0.000 5.251241 7.333391
    ------------------------------------------------------------------------------


  • #2
    first, note that Stata is telling you what the problem is in the asterisked comment below the fp results: namely, that use of robust means you no longer have a maximum likelihood estimator and thus there is no deviance; as you can see from your logistic results what you have instead is a "log pseudolikelihood"

    in the future please post your material within CODE blocks as explained in the FAQ - the material is then much easier to read

    Comment


    • #3
      Thank you so much! And sorry about the formatting - will do better next time.
      I just have one follow-up question.

      In this case, is there a way to choose one of the three options that STATA provides based on some criterion?

      Comment

      Working...
      X