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

st: gr tw (scatter if) (scatter if), by()


From   David Airey <[email protected]>
To   [email protected]
Subject   st: gr tw (scatter if) (scatter if), by()
Date   Sat, 3 May 2003 23:48:34 -0500

.scatter lens_average eye_nolens if parity <= 9, by(parity)

gives a 3 x 3 graph of nine plots (parity 1, 2 to 9)

.tw lfit lens_a eye_n if parity <= 9, by(parity)

gives a 3 x 3 graph of nine plot

.tw (scatter lens_average eye_nolens if parity <= 9) ///
(lfit lens_average eye_nolens if parity <= 9), by(parity)

gives the message:

. tw (scatter lens_average eye_nolens if parity <= 9) ///
> (lfit lens_average eye_nolens if parity <= 9), by(parity)
no observations

but completes a graph (3 x 4) leaving three holes in positions 10-12.

Is this behavior intended?

Given the first two graphs, I would have thought the by() option would travel through the overlay of the plots properly. It doesn't, at least not the way I intended.

Maybe I should have simply done,

preserve
drop if parity > 9
tw (scatter lens_average eye_nolens) ///
(lfit lens_average eye_nolens), by(parity)
restore


-Dave

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