Some recent threads have touched on this
question.
>From Stata's point of view both graphs are
graphs of -HbL- versus -HbH-. -sex- is merely
the criterion you used to select points and
it doesn't feature in the graph. Why should
it? Both -if- conditions are upstream filters
determining what gets passed to the graph-drawing
commands.
What you did can be tweaked to get what you
want, but for similar problems I favour this
kind of approach (and indeed -separate- was
written largely for this purpose):
separate HbL, by(sex)
scatter HbL? HbH , legend(order(1 "male" 2 "female"))
Nick
[email protected]
Donald Spady
>
> when I plot twoway (scatter HbL HbH if sex==1) (scatter HbL HbH if
> sex==2) I expect to get an overlaid plot with corresponding
> HbL & HbH
> having one symbol if sex==1 and another symbol if sex == 2. I get
> different symbols, but in the legend box I get a blue diamond
> signifying
> HbL and a brown diamond signifying HbL. That's right, both
> signify HbL
> and neither one signifies sex, which I expected. What is
> going on? What
> am I doing (or interpreting) wrong?
*
* 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/
Donald Spady