.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