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: Twoway by option
From 
 
Nick Cox <[email protected]> 
To 
 
"'[email protected]'" <[email protected]> 
Subject 
 
st: RE: Twoway by option 
Date 
 
Mon, 21 Mar 2011 16:30:08 +0000 
One way to do it is with the -egen- function -axis()- from -egenmore- on SSC. 
. sysuse auto
(1978 Automobile Data)
. egen mean = mean(mpg) , by(rep78)
. egen axis = axis(mean rep78), label(rep78) reverse
(5 missing values generated)
. scatter mpg weight , by(axis)
In your case, I think you need 
egen axis = axis(adv_avg school_name),  reverse label(school_name) 
Nick 
[email protected] 
Steven Archambault
I have been using the below command to generate graphs for  different schools. The graphs appear in alphabetical order of school_name, where I'd rather them be in order of their adv_avg value (highest to lowest). Is there a way to do this?
twoway (connected adv  year if group=="All Students", sort) (line adv_avg year if group=="All Students", sort), ytitle(% Proficient and Above) ///
 xtitle(Years)  by(, title(All Students)) by(school_name, style(compact)) 
*
*   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/