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

st: RE: FW: Plotting a variable against two others?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: FW: Plotting a variable against two others?
Date   Wed, 16 Jun 2004 09:04:03 +0100

The proper first place to explore is the graphics 
manual [G], although the main trick I shall 
recommend involves recourse to [R] separate. 

This sounds like wanting to draw a map of response 
in terms of latitude and longitude. I am not clear
whether you have data from a area large in comparison 
with the world as a whole, in which case you need 
to worry about the curvature of the Earth, i.e. choose
a suitable map projection, or small, 
in which case you can take the Earth to be (locally) 
flat. 

As your response is (0,1), you could do something 
like 

separate latitude, by(response) short 

This gives two new variables which you can 
then distinguish by different point symbols: 

scatter latitude? longitude, ms(oh dh) 

where the wildcard -latitude?- will pick up 
the new variables created by -separate-. 

A limitation of -scatter-, and -twoway- more
generally, is the lack of a handle for enforcing 
equal scales on y and x axes (in this case degrees of lat or long 
per cm on map). This may or may not 
matter to you, especially for exploration of data. 

Nick 
[email protected] 

Aslihan Arslan

> I have plot level data on crop varieties, and latitude and 
> longitude of each
> plot and I am trying to plot the variety data (0,1) on latitude and
> longitude axes to see whether there are some niche 
> environments dominated by
> one type of crop. 
> I have been searching in stata graphics web pages but 
> everything I found was
> on plotting one variable against another (twoway)...
> 
> I hope somebody can help me to figure out how to plot three 
> variables as I
> described above, Thank you very much!

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