Announcement

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

  • How to calculate CI from bootstrap (survival data)

    Dear community,

    I am working on a dataset from a randomized clinical trial and want to compare median survival times for two different intervention groups. So far, I had performed a logrank test. However, I was advised to rather perform a generalised Wilcoxon test and calculate the CI from bootstrap for the median difference. So far, I had only presented the median survival time of both groups descriptively.
    The aim is to present point estimates and CI (maybe + chi-square test) for the median survival rather than p-values.
    I have several questions and will present my code below:
    • Is ranksum or ststest,wilcoxon a generalised Wilcoxon test?
    • Would stcox,estimate be adequate?
    • Which part of my code would I have to bootstrap, and would it be better with the prefix or suffix command? (I understood why to boostrap, but I didn't get a functioning command yielding the results I am searching for, yet)
    Code:
    *** import data as string values
    *** format entry and exit dates and times adequately, pay attention to MDY vs DMY and hm vs hms
    *** prepare data for suvival analysis
    stset exitdatetime10TBS, failure(censored10TBS) enter(entrydatetime) origin(entrydatetime)
    gen diff=exitdatetime10TBS-entrydatetime
    sts list
    *** specify study groups
    destring Studygroup, replace
    gen rand=Studygroup
    label define randlabel 1 "Drug" 2 "Placebo"
    label values rand randlabel
    tab rand
    stsum, by(rand)
    *** run suvival analyses, chi2tail as proxy for p-value for logrank test
    sts test rand
    di chi2tail(`r(df)',`r(chi2)')
    stcox i.rand
    *** Kaplen Meier graph
    *** median survival time
    gen diffhours=diff/(1000*60*60)
    sort diffhours
    bysort Group: summarize diffhours, detail
    *** new code: play with tests etc., find out best way to compare median survival and calculate the CI from bootstrap for the median difference
    sts test rand, wilcoxon
    ranksum censored10TBS, by(rand)
    median censored10TBS, by(rand)
    stcox, estimate
    bootstrap r(p50), reps(1000) seed(1234): stsum, by(rand)
    stci, by(rand)
    bootstrap _b[rand] , reps(500) nodots : stcox rand
    estat bootstrap, all
    Thank You so much for Your assistance.
Working...
X