Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Option for repeating graph command


From   Philipp Rehm <[email protected]>
To   [email protected]
Subject   st: Option for repeating graph command
Date   Sun, 27 Jul 2008 19:46:09 +0200

.
Is there a way to ask Stata to use different y-scales when using a graph command (such as -twoway-) with the by-option?

Example:
sysuse auto, clear
replace price=100*price if foreign==1
tw (connected price weight, sort), by(foreign)

I'd rather have the y-axis on different scales. At this point, I use -graph combine-. Something like:

sysuse auto, clear
replace price=100*price if foreign==1
decode foreign, gen(F)
levelsof F, local(f)
foreach F of local f {
preserve
keep if F=="`F'"
tw (connected price weight, sort), title("`F'") name("`F'")
restore
}
graph combine Foreign Domestic

This strikes me as a bit tedious - is there a more direct way to do this?

Stata 9, Win XP.

Many thanks for your help,
Philipp


*
* 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index