Announcement

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

  • Graphs using stcrreg and stcurve

    Dear all,

    I hope that someone can help me on this small issue.

    Setting: I have a population of leukemia patients and I am investigating the prognostic impact of cytogenetic aberrations. In the analysis of relapse, death should be accounted for as a competing risk.

    Problem: I made my plot of the cumulative incidens function with death as competing risk using this code:
    stset time_to_prim_event, failure(dead_or_relapse==2)
    stcrreg extra8plus_additional, compete(dead_or_relaps==1)
    stcurve, cif at1(extra8plus_additional=1) at2(extra8plus_additional=2) at3(extra8plus_additional=3) /*
    */ title("Relapse") /*
    */ yscale(range(0 0.5)) /*
    */ xtitle("Years since diagnosis") /*
    */ ytitle("Probability of relapse")/*
    */ ylabel(0 "0%" 0.1 "10%" 0.2 "20%" 0.3 "30%" 0.4 "40%" 0.5 "50%", nogrid) /*
    */ xscale(range(0 10)) /*
    */ legend(row(3) col(1) /*
    */ order(3 "No trisomy 8 (N=509)" 2 "Trisomy 8 alone(N=18)" 1 "Trisomy 8 + other (N=69)") /*
    */ ring(0) position(5)) /*
    */ graphregion(color(white) margin(small )) /*
    */ plotregion( lstyle(foreground)) /*
    */ bgcolor(white)

    This gave the first figure that I have included. What surprised me was how "nice" i looked. When I had a colleague do the same figure in R this confirmed that my figure could not be right.

    So, I have two questions. What is it that I have plotted, and how do I get the right plot?

    ​I look forward to your reply.

    Best,
    Peter



  • #2
    Hi "asdahl" (please use name and family name),

    By looking at both pictures, it seems yours has 3 groups ("at", "at", "at"), and your colleague's has 6 groups. Therefore, they should differ.

    Yes, Stata's graphic display is really awesome.

    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #3
      With regards to performing graphs related to survival analysis, I suggest you try "help sts graph".


      Finally, if you are interested in delving into Stata graphics, besides the excellent manual, I'd suggest 2 great books:

      A Visual Guide to Stata Graphics, Michael Mitchell, 3rd edition
      Speaking Stata Graphics, Nicholas Cox

      Best,

      Marcos
      Last edited by Marcos Almeida; 08 Jan 2015, 10:24.
      Best regards,

      Marcos

      Comment


      • #4
        The postestimation -stcurve- command makes curves based on the estimated parameters, and these curves are "too nice" compared to empirical curves. Take a look at the unofficial - stcompet- command; it may help you doing what you need.

        Comment


        • #5
          I should clarify the the three curves at the bottom of the figure from R is the risk of dying, i.e. the competing risk.

          Thank you Svend. I was exactly that kind of information I was after. I will try to go forward with -stcompet- instead.

          Peter.

          Comment


          • #6
            Svend Juul What do you mean when you say that the stcurve is to nice?
            I am plotting cumulative incidence function by two groups after stcrreg using the stcurve function.

            secondly i cannot get my legends to say what i want them to:

            Code:
            stcurve, cif at1(group=0) at2(group=1) title("TITLE") xtitle("Years of Life") leg(lab(1 "group 1" 0 "group 2" )) graphregion(color(white) margin(medium))
            it gives me legends where it says group 1 1 group 2 // group=1

            what am i doing wrong?
            Lars

            Comment

            Working...
            X