Announcement

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

  • confidence intervals with KM graphs in weighted data- stata error: option not possible

    hi, is there a way out to plot Confidence intervals in a KM graph in weighted data?

    By inserting CI - in stata, the following error comes up:
    option ci is not allowed with pweighted data

    Code:
    stset died [pw=attweight], failure(died==1) exit(time 1)
    sts graph, by(treatment) per (100) ci title("Survival %") ylabel(90(0.5)100) scheme(white_jet) plot1(colour(orange_red)) plot2(colour(blue)) legend(order(1 "Tx1" 2 "Tx2"))
    is there as solution to this?

  • #2
    Stata would seem to think the usual estimator is not valid for probability weighted data, and I don’t know of a suitable method for your application.

    Comment


    • #3
      note that the manual (p. 426 of st.pdf) says, "If the data are pweighted, these formulas are not appropriate, and then confidence intervals are not reported." you can see the formulas being referred to by going to that page in the manual (note that the page number comes from a fully updated version of StataNow 18.5 - if you have a different version, you can probably find this same sentence by going to -sts- entry in this manual and clicking on "methods and formulas")

      Comment


      • #4
        Thanks , I am aware that stata won’t allow one to plot confidence intervals with weighted data

        but there must be an alternative….


        is anyone aware of an alternative? Perhaps manually calculating the CI ? Although I’m not the expert in this regard…

        i just can’t believe that stata doesn’t support CI plot for weighted data esp on version 18…

        Comment


        • #5
          It’s not so much a question of whether Stata does or doesn’t support something. It must first be established whether there is a valid statistical method to do what you want. Have you searched the literature about this?

          Comment


          • #6
            As far as I know it is valid, why wouldn’t one plot confidence intervals whilst using weights following IPTW in a cohort study ?

            It has been asked before

            https://www.stata.com/statalist/arch.../msg01363.html

            the reply from the individual wasn’t sure, in fact I tried it out myself but didn’t work

            in terms of the concept I know I need to manually calculate

            1.96 * se

            However, I’m not sure If I should be working with means of the two treatment groups

            for eg:

            if there are t1 t2 treatment groups, the weight would be
            attweignt*t1
            attweigjt*t2

            one may find the means of t1 and t2 = m1 m2
            the weights would be = attweigjt*m1
            attweigjt*m2

            one would find the stand errors using

            tabstat t1 t2, stat(semesn) [aw=attweight)


            Then upperCI = 1.96 * se
            lowerci= -1.96*se

            Comment

            Working...
            X