Announcement

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

  • stcurve with risk table - Q asked in 2015

    Hi can I confirm to date there is no option to create a risk table with -stcurve-

    This was asked in 2015 - and no answer was given. I tried using

    Code:
    stcurve, hazard at 1(drug=1) at2(drug=2) risk table(, order(1"Placebo" 2"Treatment") row title(, justification(left)) title(, at(rowtitle)))
    https://www.statalist.org/forums/for...-risk-analysis

    Stata creates an error: risk table not allowed.
    Trying to create something similar (I'm aware that the Y axis is a probability)

    Click image for larger version

Name:	Screenshot 2023-09-13 at 20.11.53.png
Views:	1
Size:	278.3 KB
ID:	1727041

  • #2
    The option risktable (notice, one word) is available in sts graph, which makes sense: the number of people at risk is defined for simple descriptives like sts graph, but it is not clear how to define it with control variables like stcurve.
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Just used risktable with sts graph.
      Just wondering if anyone knows how to move the legend to stop it from obstructing the figure?

      Code:
      Sts graph, by(vol) risk table
      
      legend(order(1”Low” 2 “mEDIUM” 3 “hiGH) ring(0) cols(1) pos(1) ///
      
      Label(0(0.2)1, angle(h) format(%3.1f))
      In addition,

      I just thought I'd add it here - for anyone who looks for this in the future - this provides some more flexible modelling and better graphics
      https://pclambert.net/software/stpm2...ized_survival/
      Attached Files
      Last edited by Tara Boyle; 13 Sep 2023, 13:44.

      Comment


      • #4
        You have it on the one o'clock position:

        legend(order(1”Low” 2 “mEDIUM” 3 “hiGH) ring(0) cols(1) pos(1) ///
        Label(0(0.2)1, angle(h) format(%3.1f))
        Either, choose a different clock position or remove it entirely from the plot region by deleting

        Code:
        ring(0)
        Last edited by Andrew Musau; 13 Sep 2023, 15:35.

        Comment


        • #5
          Thanks

          Comment

          Working...
          X