Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: legends after sts graph and addplot
From
<[email protected]>
To
<[email protected]>
Subject
st: legends after sts graph and addplot
Date
Sun, 06 Feb 2011 14:52:44 +0000
Dear Stata experts
Stata seems to ignore legend options when addplot is used after sts graph
The code:
sts graph if hivstatus==1 & artavail==0, surv tmax(60) xlabel(0(5)60, valuelabel) xtitle(age) ///
addplot(line weibsurv _t if _t<60, sort) legend(label(1 "observed") label(2 "fitted"))
produces exactly the same graph as
sts graph if hivstatus==1 & artavail==0, surv tmax(60) xlabel(0(5)60, valuelabel) xtitle(age) ///
addplot(line weibsurv _t if _t<60, sort)
There are limits to what I can achieve using variable names for the added curves if I want to add more lines, such as confidence bounds on the fitted curve
Also, is there any way to tell stata to plot the addplot lines BEFORE the sts graph, so that the observed kaplan-meier survival curve appears as the topmost graph?
Thanks, Basia
*
* 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/