Announcement

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

  • issues with Stsgraph legends with confidence interval option

    Hello all, previously I never have issues when I generate sts graph with "ci" option, it automatically knows to assign different colors to the different strata and create line legends for their respective confidence intervals. However when I tried to generate today using this code:
    Code:
    sts graph, by(stratacig)  ytitle("Proportion of cancer cases") legend(order(1 "Never smoker" 2 "Ever smoker, <20 packyrs" 3 "Ever smoker, 20+ packyrs")) xtitle("Followup time (years)") note("P=0.005") title("Progression free survival") ci
    I saw this:
    Click image for larger version

Name:	sts graph ci.JPG
Views:	1
Size:	81.0 KB
ID:	1753582

  • #2
    Your manual labeling does not necessarily correspond to the order of plots. With 3 pairs of CIs and lines, perhaps you need:

    Code:
    legend(order(1 "Never smoker" 2 "" 3 "Ever smoker, <20 packyrs" 4 "" 5 "Ever smoker, 20+ packyrs" 6 "") row(3))
    A data example is needed if the above is not helpful.

    Comment

    Working...
    X