Bookmark and Share

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: RE: sts graph: specifying line pattern options - addendum


From   "Philip Ryan" <[email protected]>
To   <[email protected]>
Subject   st: RE: sts graph: specifying line pattern options - addendum
Date   Mon, 24 May 2010 16:38:47 +0930

Michael,

You could also bypass the problem with -sts graph- by constructing the K-M
plot yourself:

sts gen surv=s
separate surv, by(drug) 
graph twoway line surv1 surv2 surv3  studytime,  ///
 sort connect(J J J) lpattern("."  "-"  ".-.") lwidth(medthick medthick
medthick)

Phil

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Michael McCulloch
Sent: Monday, 24 May 2010 2:16 PM
To: Statalist Statalist
Subject: st: sts graph: specifying line pattern options

Greetings,
In v9 of Stata, I used to specify line pattern options in -sts graph-.  
In the example that follows, one group would be plotted in a solid  
line, one in dash, and one in long dash. All in black:

*** begin example
clear
sysuse cancer.dta
stset studytime, failure(died)
version 9: sts graph, by(drug) lpattern(l - _) lcolor(black blue red)
*** end example

In v11, -lpattern()- needs to be contained within option -plotopts-,  
but in this example below, all  three groups have the same line  
pattern and color:
. sts graph, by(drug) plotopts(lpattern(l - _) lcolor(black blue red))

I tried "formula", but this makes all three groups
sts graph, by(drug) plotopts(lpattern("l - _") lcolor(black blue red))

Any help would be appreciated,

Michael McCulloch, LAc MPH PhD
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391

*
*   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/

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index