Announcement

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

  • Bootstrap for internal validation of cox model

    Hi, I am trying to make internal validation of a cox PH model using bootstrap, and also a time dependent ROC and I do not know how to do it. Can anyone kindly help me?
    This is how I set the model and a extract of the data.

    stset Followup, failure (survival=0)
    stcox RM2 i.ISUP psa12 LYM

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte survival double Followup float(ISUP psa12) long(LYM RM2) byte(_st _d) double _t byte _t0
    1 135.93333333333334 1 .003 0 0 1 0 135.93333333333334 0
    1  78.23333333333333 1 .003 0 0 1 0  78.23333333333333 0
    1                 32 1 .003 0 0 1 0                 32 0
    1               38.1 1 .008 0 0 1 0               38.1 0
    1 137.03333333333333 1 .003 0 0 1 0 137.03333333333333 0
    1  44.63333333333333 1 .003 0 0 1 0  44.63333333333333 0
    1 34.833333333333336 1 .003 0 0 1 0 34.833333333333336 0
    0                 27 1  .06 0 1 1 1                 27 0
    1 24.333333333333332 1 .008 0 0 1 0 24.333333333333332 0
    1  5.766666666666667 5 .003 0 1 1 0  5.766666666666667 0
    1              127.8 1 .003 0 0 1 0              127.8 0
    1 133.53333333333333 1  .17 0 1 1 0 133.53333333333333 0
    1  8.533333333333333 1 .003 0 1 1 0  8.533333333333333 0
    1 3.6666666666666665 5 .003 0 1 1 0 3.6666666666666665 0
    0                  0 5   .3 0 1 0 .                  . .
    1 131.13333333333333 1 .007 0 0 1 0 131.13333333333333 0
    1  37.96666666666667 5 .008 0 0 1 0  37.96666666666667 0
    1  79.26666666666667 5 .009 0 0 1 0  79.26666666666667 0
    1 101.86666666666666 1 .002 0 0 1 0 101.86666666666666 0
    1  9.966666666666667 1 .004 0 1 1 0  9.966666666666667 0
    1 20.933333333333334 5 .008 0 0 1 0 20.933333333333334 0
    1  63.53333333333333 1 .002 0 0 1 0  63.53333333333333 0
    0                  0 5    . 1 0 0 .                  . .
    0 13.666666666666666 5   .3 0 0 1 1 13.666666666666666 0
    0                  0 5    . 0 0 0 .                  . .
    1               15.3 1 .004 0 0 1 0               15.3 0
    1              120.1 5 .005 0 0 1 0              120.1 0
    1 11.333333333333334 5 .004 0 0 1 0 11.333333333333334 0
    1                3.9 1 .008 0 0 1 0                3.9 0
    1               49.9 5 .003 0 0 1 0               49.9 0
    1 55.333333333333336 5 .009 0 0 1 0 55.333333333333336 0
    1                5.3 1  .19 0 1 1 0                5.3 0
    0                9.7 5  .06 0 0 1 1                9.7 0
    1 12.633333333333333 5 .006 0 1 1 0 12.633333333333333 0
    0               25.8 5 .156 0 0 1 1               25.8 0
    1 120.06666666666666 5 .004 0 0 1 0 120.06666666666666 0
    1 22.066666666666666 1 .004 0 0 1 0 22.066666666666666 0
    1 58.233333333333334 1 .003 0 0 1 0 58.233333333333334 0
    1               13.2 1  .06 0 0 1 0               13.2 0
    0  95.23333333333333 1 .012 0 0 1 1  95.23333333333333 0
    1  55.43333333333333 5 .002 0 0 1 0  55.43333333333333 0
    0 20.433333333333334 5  .14 1 0 1 1 20.433333333333334 0
    1                3.9 5 .006 0 1 1 0                3.9 0
    1               90.6 1 .003 0 0 1 0               90.6 0
    0  87.16666666666667 5 .008 0 0 1 1  87.16666666666667 0
    0  4.366666666666666 1 .008 0 0 1 1  4.366666666666666 0
    1  65.23333333333333 1 .009 0 0 1 0  65.23333333333333 0
    1  50.06666666666667 5 .003 0 0 1 0  50.06666666666667 0
    1  59.03333333333333 1 .003 0 0 1 0  59.03333333333333 0
    1  73.23333333333333 5 .008 0 0 1 0  73.23333333333333 0
    1 118.43333333333334 1 .113 0 1 1 0 118.43333333333334 0
    1                4.3 . .008 . . 1 0                4.3 0
    1  53.96666666666667 1 .008 0 1 1 0  53.96666666666667 0
    1  51.46666666666667 1 .008 0 0 1 0  51.46666666666667 0
    0 53.733333333333334 5 .008 0 0 1 1 53.733333333333334 0
    1  50.06666666666667 1 .003 0 0 1 0  50.06666666666667 0
    1                4.6 1  .15 0 1 1 0                4.6 0
    1 17.866666666666667 5 .008 0 0 1 0 17.866666666666667 0
    0 22.266666666666666 1   .1 0 1 1 1 22.266666666666666 0
    1 49.833333333333336 1 .009 0 0 1 0 49.833333333333336 0
    1               59.1 1 .009 0 0 1 0               59.1 0
    1               48.9 1 .009 0 0 1 0               48.9 0
    1               10.1 1 .008 0 0 1 0               10.1 0
    1               13.6 1 .008 0 0 1 0               13.6 0
    0               29.7 5 .029 0 0 1 1               29.7 0
    1  4.066666666666666 1 .008 0 1 1 0  4.066666666666666 0
    1               16.1 1 .008 0 0 1 0               16.1 0
    1  59.56666666666667 1 .009 0 0 1 0  59.56666666666667 0
    1 115.86666666666666 1  .02 0 0 1 0 115.86666666666666 0
    0 16.866666666666667 4 .018 0 1 1 1 16.866666666666667 0
    1  66.33333333333333 1 .009 0 0 1 0  66.33333333333333 0
    1              114.1 1 .009 0 . 1 0              114.1 0
    0 10.133333333333333 5   .3 0 0 1 1 10.133333333333333 0
    1 54.266666666666666 1 .009 0 0 1 0 54.266666666666666 0
    1  70.26666666666667 1 .006 0 0 1 0  70.26666666666667 0
    0 17.866666666666667 5 .015 1 1 1 1 17.866666666666667 0
    1 18.433333333333334 1 .008 0 0 1 0 18.433333333333334 0
    1 18.433333333333334 1 .012 0 0 1 0 18.433333333333334 0
    1 14.533333333333333 1 .012 0 1 1 0 14.533333333333333 0
    1  52.63333333333333 1 .003 0 0 1 0  52.63333333333333 0
    1                4.6 1 .008 0 0 1 0                4.6 0
    1               26.6 1 .003 0 0 1 0               26.6 0
    1               20.3 1 .008 0 0 1 0               20.3 0
    1 13.666666666666666 1 .013 0 0 1 0 13.666666666666666 0
    1 24.666666666666668 5  .01 1 0 1 0 24.666666666666668 0
    0 23.466666666666665 5  .18 0 0 1 1 23.466666666666665 0
    1  51.63333333333333 5 .009 0 0 1 0  51.63333333333333 0
    1 14.133333333333333 1 .008 0 1 1 0 14.133333333333333 0
    1  4.133333333333334 1 .008 0 0 1 0  4.133333333333334 0
    1  80.53333333333333 1 .008 0 0 1 0  80.53333333333333 0
    1  91.46666666666667 5 .003 0 0 1 0  91.46666666666667 0
    1 39.733333333333334 1 .009 0 0 1 0 39.733333333333334 0
    1 14.133333333333333 5 .008 0 1 1 0 14.133333333333333 0
    0               56.3 1   .1 0 0 1 1               56.3 0
    1               16.9 5  .17 0 1 1 0               16.9 0
    1  82.93333333333334 5 .003 0 0 1 0  82.93333333333334 0
    1 40.666666666666664 1 .008 0 0 1 0 40.666666666666664 0
    0 19.433333333333334 5  .09 0 1 1 1 19.433333333333334 0
    1 16.233333333333334 1 .008 0 0 1 0 16.233333333333334 0
    1  43.46666666666667 1 .003 0 0 1 0  43.46666666666667 0
    end
    Thanks in advance!

  • #2
    For the stcox this is easy:

    Code:
    stcox RM2 i.ISUP psa12 LYM, vce(bootstrap, reps(500) seed(123))
    What other commands are you using?
    Best wishes

    (Stata 16.1 MP)

    Comment


    • #3
      Dear Felix, Thank you so much for your help!
      Do you know how may I perform a calibration plot? Something like the pmcalplot command for logistic regression, but for cox models?

      Comment


      • #4
        since -pmcalplot- has options specifically for cox models, your question is more than a bit unclear - what do you want that is not in -pmcalplot-?

        Comment


        • #5
          Dear Rich, thank you for your answer. Sorry that my post was unclear. I was trying to do a calibration plot of the nomogram generated by the cox model ( attached performed in R), and a time-dependent ROC.
          Click image for larger version

Name:	Imagen1.png
Views:	1
Size:	18.5 KB
ID:	1636193

          Last edited by Leandro Blas; 11 Nov 2021, 19:36.

          Comment


          • #6
            :@Lean Bias If that's your real name, there will be some wry humour at your expense in any statistical group.

            But I guess otherwise. Please note our explicit request to use full real names here.

            https://www.statalist.org/forums/help#realnames

            Comment


            • #7
              Dear Nick, it is not lean bias is Leandro BLAS. Sorry for the misunderstanding. I have sent an e -mail to the administrator to change it.

              Comment


              • #8
                Thanks for the explanation and sorry for misreading your name.

                Comment

                Working...
                X