Announcement

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

  • Overlaying Kaplan-Meier failure curves on one graph

    Dears,
    I am trying to graph 3 Kaplan Meier failure graph on a one graph. My using data is 3 different doses of vaccination for children. So there are 3 separate graphs for every observation. How I should construct this one? I did not find any solution for it even I looked at different sources. Found out few overlaying survival graph construction suggestion.


    Thanks in advance?

  • #2
    -sts graph- has a -by()- option which enables you to do this. So something like
    Code:
    sts graph, by(dose)
    will do it.

    Comment


    • #3
      Dear Clyde Schechter,
      Thank you for your quick reply. But I could not do much according to your suggestion. I tried differently and got a result as an attachment. But still, I could not get my desired result. Let me clarify: on the overlaid graph, I wanna show failure curves (blue, yellow, green) with 95%CI. But I could not get it beside the blue curve. Here is my syntax for the graph. What is wrong with it? Please clarify. Sorry for me, I am really new to stata.

      stset durinmonth, failure(BCGstatus==0) scale(1)
      sts gen s2=s
      stset durmonOPV0, failure(OPV0status==0) scale(1)
      sts gen s3=s
      stset durmonHB, failure(HBstatus==0) scale(1)
      sts graph, failure ci addplot(( line s2 durinmonth, sort c(J)) (line s3 durmonOPV0, sort c(J)))





      Regards,
      Egi


      Attached Files

      Comment


      • #4
        Clyde is correct. In your first post you said that there are three dose groups. In your last post, you say that there are three different failure outcomes, depending on which dose a person had. However this is wrong: there is only one failure outcome: appearance of the disease that the vaccine is supposed to prevent. Define a single time-variable and a single status variable (say "fstatus") with code = 1 for failures and = 0 for nonfailures. Call the time variable "duration".
        Then
        Code:
        stset duration, fail(fstatus =1)
        sts graph, by(dose)
        Last edited by Steve Samuels; 26 Jul 2018, 11:43.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment

        Working...
        X