Announcement

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

  • optimism in flexible parametric survival analysis by stpm2, please

    Dear Professor Lambert, Professor Royston and other statalists,

    I am doing prognostic modelling and I would like to do internal validation and get Dxy, R2, slope, D (as example below in R from function validate from rms package)
    So I can use new c statistics, shrunk model and new intercept.


    index.orig training test optimism index.corrected n
    Dxy 0.4393 0.4676 0.4066 0.0610 0.3783 200
    R2 0.0614 0.0742 0.0529 0.0213 0.0400 200
    Slope 1.0000 1.0000 0.8613 0.1387 0.8613 200
    D 0.0518 0.0632 0.0444 0.0189 0.0329 200
    U -0.0034 -0.0036 0.0037 -0.0073 0.0038 200
    Q 0.0552 0.0668 0.0406 0.0262 0.0291 200
    g 0.8751 0.9585 0.8046 0.1538 0.7213 200
    How I get these information after I use stpm2 command, please?

    Also, if I use MICE or ICE package how can I use with stpm2 and do internal validation, please?

    P.S I cannot get these values from R with function validate because it doesn't support rstpm2 package
    P.S I have tried boostrap command in stata but it can display only bootstrp standard error. How can I get optimism and index.corrected?
    Last edited by Kullathorn Thephamongkhol; 10 Sep 2018, 16:32.

  • #2
    I have tried this command below: to calculate the bias-corrected C statistics in stcox first (and I will use in stpm2 later)

    ////
    stset fuptime, failure(hipfrac )

    capture program drop b_conc
    program define b_conc, rclass
    stcox sex smoking prevfrac age10 weight10, nohr
    estat concordance
    return scalar c = r(C)
    end
    bootstrap c=r(c), reps(500): b_conc
    estat bootstrap, all

    ////

    I got this results:

    | Observed Bootstrap
    | Coef. Bias Std. Err. [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    c | .71963748 .0055138 .04872778 .6241328 .8151422 (N)
    | .6304039 .8140494 (P)
    | .6130046 .7974204 (BC)

    I interpreted that the corrected c statistics is .71963748 - .0055138 = 0.71412368


    Unfortunately, I have tried this in R software as below (Dxy = 0.4393, corrected Dxy = 0.3920) then corrected c statistics = (0.3920+1)/2 = 0.696


    index.orig training test optimism index.corrected n Dxy 0.4393 0.4568 0.4096 0.0472 0.3920 500

    I think it's too different from two software. (stata is too good) I have checked that coefficient in stata and in R are exactly the same.

    Please correct me if I am wrong.

    Comment


    • #3
      So when I use this below for stpm2, I am not sure I can believe the results: (because I check with stcox in R and in stata , C statistics is very different)

      capture program drop b_conc

      . program define b_conc, rclass
      1. stpm2 sex smoking prevfrac age10 weight10, df(3) scale(haz)
      2. stcstat2
      3. return scalar c = r(C)
      4. end

      . bootstrap c=r(c), reps(500): b_conc


      ------------------------------------------------------------------------------
      | Observed Bootstrap Normal-based
      | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      c | .7193295 .0468472 15.35 0.000 .6275106 .8111484
      ------------------------------------------------------------------------------



      Any suggestions will be appreciated.

      Comment

      Working...
      X