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: to change bar colors in a histogram
From
"Radwin, David" <[email protected]>
To
<[email protected]>
Subject
st: RE: to change bar colors in a histogram
Date
Fri, 14 Feb 2014 14:18:37 -0500
Antonio,
I am not sure I understand your situation, but it sounds like instead of a histogram with 2 bars, you want a graph of proportions. Try -catplot- (Nick Cox, available from SSC), perhaps with the -asyvars- option to show different colors.
David
--
David Radwin, Senior Research Associate
Education and Workforce Development
RTI International
2150 Shattuck Ave. Suite 800, Berkeley, CA 94704
Phone: 510-665-8274
www.rti.org/education
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of Antonio Rodriguez Andres
> Sent: Friday, February 14, 2014 10:43 AM
> To: [email protected]
> Subject: st: to change bar colors in a histogram
>
> Dear Stata users
>
> I am trying to create a histogram for the proportion of the population
> having mental health problems (Yes or No). The mental
> health measure is binary. I want to create a simple histogram with the bar
> color different for each response Yes or No. That is my Stata
> code
>
> histogram MENTAL, discrete bcolor(blue) barw(0.5) addlabel percent xlabel
> (1
> "Yes" 0 "NO") title("Mental Health Problems: Total Population")
>
> Any advice
>
> Thanks in advance
>
> Antonio
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/