Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Re: The foreach command for values within a variate


From   Ulrich Kohler <[email protected]>
To   [email protected]
Subject   Re: st: Re: The foreach command for values within a variate
Date   Thu, 1 Jul 2004 09:02:50 +0200

Elias Obudho wrote:
> I am working on graphics and would like to use the
> foreach command to combine several bar graphs made
> using the same categorical variate (district) but for
> different districts.  This would enable me to compare
> different districts.   I am able to use the command
> for different variates ( say district, sex, etc) but
> not for different values within a variate.  Need your
> suggestions.

What about something like

. levels district, local(K)
. foreach k of local K {
.	graph bar myvar if district == `k'
. }

regards
uli

-- 
[email protected]
+49 (030) 25491-361


*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index