Announcement

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

  • Fractional polynomials in stata (different size n)

    Hi everyone,

    Thanks in advance for your help. I am running a cox regression model and ran fractional polynomials on age in the dataset (among the rest of the variables that I want in my regression) and found that FP weight (0.5, 0.5) is best. However, if I drop (age_1 and age_2) and run fp generate ^age (0.5, 0.5), essentially recreating this, about 60K more individuals are in my model (5,507,332 vs. . Why is this? I sometimes need to recreate the FP because my dataset is large and I'm returning to my analysis.


    Thank you.
    ___________________________________________

    Model after the original FP :

    fp <age>: stcox <age> ib2.bmi_clincat i.fin_gender i.aud_ard_ever i.aud_cat i.smknum hiv_ever tot_panc i.fin_raceeth diabetes_ever hcv_chron cyst currentcancer if age>18 & age<90 & bmi> 14 & bmi <70
    (fitting 44 models)
    (....10%....20%....30%....40%....50%....60%....70% ....80%....90%....100%)

    Fractional polynomial comparisons:
    -------------------------------------------------------------------
    | Test Deviance
    age | df Deviance diff. P Powers
    -------------+-----------------------------------------------------
    omitted | 4 709982.18 14108.24 0.000
    linear | 3 697341.73 1467.79 0.000 1
    m = 1 | 2 695957.52 83.58 0.000 -2
    m = 2 | 0 695873.94 0.00 -- .5 .5
    -------------------------------------------------------------------
    Note: Test df is degrees of freedom, and P = P > chi2 is sig. level
    for tests comparing models vs. model with m = 2 based on
    deviance difference, chi2.

    Cox regression with Breslow method for ties

    No. of subjects = 5,507,332 Number of obs = 5,507,332
    No. of failures = 23,922
    Time at risk = 59,940,509
    LR chi2(21) = 18687.85
    Log likelihood = -347936.97 Prob > chi2 = 0.0000

    Model after fp generate:

    fp generate age^(0.5, 0.5)

    . stcox age_1 age_2 ib2.bmi_clincat i.fin_gender i.aud_ard_ever i.aud_cat i.smknum hiv_ever tot_panc i.fin_raceeth diabetes_ever hcv_chron cyst currentcancer

    Failure _d: totpdac_10yr_dp
    Analysis time _t: time_10yr
    ID variable: scrssn


    Cox regression with Breslow method for ties

    No. of subjects = 5,565,414 Number of obs = 5,565,414
    No. of failures = 14,169
    Time at risk = 1.91032e+10
    LR chi2(21) = 14107.52
    Log likelihood = -212012.11 Prob > chi2 = 0.0000

Working...
X