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: xtline: options for line color


From   "Alison Drake" <[email protected]>
To   <[email protected]>
Subject   st: xtline: options for line color
Date   Tue, 20 Jul 2010 13:40:40 -0700

I would like to change the color of lines for subgroups on a graph generated
by xtline.  I want to create an overlay of the lines by 2 different groups,
group 0 and 1 and have the lines for group 0 be one color and group 1 be
another color.  Currently, I can?t figure out how to change the line options
unless I use a scheme, and I haven?t been able to adjust the line options by
groups.

The code I am using now (which I have also added 2 lowess curves to) shows
the plasmaVL for each id using the sj scheme color (see below).  Can anyone
help me get different colors of lines by group? Instead of scheme(sj) I have
tried lcolor (green) to try to adjust the color for all, as well as lcolor
if group==0 or if group==1 without success.  I?m not sure this is possible
with xtline?

xtset idno visitno
xtline plasmaVL,   overlay legend(off) scheme(sj) xlabel(0(1)1)
title("Plasma HIV viral load over time, by treatment group")  ytitle("Log10
copies/mL") /*
*/ xtitle("Visit number")  addplot ((lowess plasmaVL visitno if group==0,
lcolor(blue) lpattern(solid) lwidth(thick))/*
*/(lowess plasmaVL visitno if group==1, lcolor(red) lpattern(solid)
lwidth(thick)))

Thanks,

Alison Drake, MPH
Pre-doctoral Fellow
Department of Epidemiology
University of Washington
Box 359909
Seattle, WA 98195-7236
phone: (206) 579-9211
email: [email protected]



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