|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: sts graph: customizing -legend- option of -sts graph-
From |
Michael McCulloch <[email protected]> |
To |
Statalist <[email protected]> |
Subject |
st: sts graph: customizing -legend- option of -sts graph- |
Date |
Tue, 9 Sep 2008 14:43:37 -0700 |
Hello,
I've created a KM plot comparing two troups, and have used the
-legend- option. Note in the 1st graph example that they're labeled
1, 2, and 3.
Also note that in the second example, after dropping "drug 2", that
even though 1 and 3 are left, they're labelled 1 and 2. If I've
dropped 2, I'd like to see the labels say 1 and 3! Is there a way to
do this?
sysuse cancer.dta, clear
stset studytime
* graph 1
sts graph, by(drug) atrisk legend(label(1 "drug 1") label(2 "drug 2")
label(3 "drug 3")) ///
drop if drug==2
* graph 2
sts graph, by(drug) atrisk legend(label(1 "drug 1") label(2 "drug 2")
label(3 "drug 3")) ///
--
Best wishes,
Michael McCulloch
Pine Street Foundation
124 Pine St., San Anselmo, CA 94960-2674
Tel: (415) 407-1357
Fax: (415) 485-1065
[email protected]
www.pinestreetfoundation.org
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/