Announcement

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

  • sts graph ciopts query

    I was configuring my sts graph to decrease the opacity of the CI bands and get rid of the lines at the bands of the CI and also not plotting the 95% CI in the legend. Somehow my ciopts are affecting the legends whenever I work with the ciopts area_options. I want the legend to only showing the two groups and their lines at 100% opacity.
    Sorry I am unable to dataex since there are too many nested include files grabbing numbers. But see attached image to see the issue.

    Code:
    sts graph, by(`b') risktable ci ciopts(fcolor(%5)) ///
                title("`title'", color(black) size(medium)) ///
                xtitle("Time since Transformation (years)", size(small)) ///
                xlabel(0(1)5.35, labs(small)) ylabel(0(0.25)1, angle(0) labs(small)) ///
                ytitle("Proportion surviving", size(small) margin(medium)) ///        
                text(`kos1n' 5.23 "`kos1'" $sts_txt_opts2) ///
                text(`kos0n' 5.23 "`kos0'" $sts_txt_opts2) ///
                risktable(0(1)5 , size(small) order(1 "`vl0'" 2 "`vl1'")) ///
                text(.75 5 "Medn. surv.: {bf:`ms1' {it:vs.} `ms0'} yrs" "Log rank {it:P} {bf:`pvalue'}" $sts_txt_opts) ///
                legend(order (1 "No BCL2i" 2 "Check 95%CI" 3 "BCL2i" 4 "CHeck2 95% CI")$sts_leg_opts)
    Attached Files
    Last edited by Girish Venkataraman; 16 Jun 2023, 12:39. Reason: Attached too many duplicate images

  • #2
    I recently queried with Stata Technical Services on the same topic. Here's a minimal example that I used. -lwidth(none)- controls the line thickness for the bounding area of the confidence band. It needs to be specified for the general and specific ciopts(). Second, apparently the legend levels 5 and 6 are for the curved lines.

    Code:
    webuse drug2, clear
    
    sts graph, by(drug) ci risktable(, order(1 "Placebo" 2 "Test drug")) ///
               plot1opts(lcol(green)) plot2opts(lcol(red)) ///
               ciopts(lwidth(none)) ///
               ci1opts(color(orange%20) lwidth(none)) ci2opts(color(blue%20) lwidth(none)) ///
               legend(order(5 "line1" 6 "line2") position(6))

    Comment


    • #3
      Originally posted by Leonardo Guizzetti View Post
      I recently queried with Stata Technical Services on the same topic. Here's a minimal example that I used. -lwidth(none)- controls the line thickness for the bounding area of the confidence band. It needs to be specified for the general and specific ciopts(). Second, apparently the legend levels 5 and 6 are for the curved lines.

      Code:
      webuse drug2, clear
      
      sts graph, by(drug) ci risktable(, order(1 "Placebo" 2 "Test drug")) ///
      plot1opts(lcol(green)) plot2opts(lcol(red)) ///
      ciopts(lwidth(none)) ///
      ci1opts(color(orange%20) lwidth(none)) ci2opts(color(blue%20) lwidth(none)) ///
      legend(order(5 "line1" 6 "line2") position(6))
      That worked well, Leonardo Guizzetti . Would never have guessed a 5 and 6. On a similar note, does the lb(s) and ub(s) in -sts gen- generate the numbers to plot the CI bands? I was fiddling around with that with the possibility of trying out with a -twoway- graph option for the same with the risk table.

      Comment


      • #4
        That's what the manual suggests -help sts gen-.

        Comment

        Working...
        X