* show the projection details and compute the plot's height Geo2xy lat lon, gen(ylat xlon) project(mercator) * project lat/lon to (x,y) in meters using a Mercator projection When creating a map in Stata, you need to be sure to create a map region that has the correct proportions (xsize() and ysize() are proportional to the distance). To center them on the middle of the map, all you need is to offset them from the mean. The y-coordinates are in meters from the equator. The projection is centered at mid-longitude by default which means that x-coordinates will be in meters from the center of the map. Since you want coordinates that are based on distance units, I chose a true Mercator projection which creates (x,y) coordinates in meters. With geo2xy (from SSC), you can use the same projection that Google Maps uses so the map you create will have exactly the same proportion that you would observe on Google Maps. If you are going to create a map with geographic coordinates, you first need to convert these to planar (x,y) coordinates. So, how can I create a scale bar for each of x and y to show what, for example, 100m looks like? In this example, the y scale would look different than the x scale, so maybe I need to find a way to change the y-ranges and x-ranges so that they can represent the same scale? But for what I need this visualization for, and the fact that these data are usally clustered within 2km of each other, its accurate enough. the distance from ymin to ymax/2 may not be precisely the same as half the distance between ymin and ymax). Note: I know that on a spherical projection of the earth the distance between ymin and ymax may not map perfectly onto subsets of that distance (e.g. Now, we can get a sense of the distance between the minimum and maximum latitude/longitude using the following: * Store x and y ranges in localsįor this data, y spans 0.2km and x spans 0.329km. This is great, but I have no idea how far the points actually are from each other. You should get a lovely basic scatterplot. * Create y/x axis ranges using min and max latitude and longitude If _rc = 111 ssc install geodist // Installs geodist if necessary * Install Geodist (we will need this later) #Geodist install stata code#Here is some code to input a few coordinates and graph a scatterplot, specifying the axis ranges: * Input example data I would like to add a scale bar for both the x and y axes to get a sense of how far apart the points actually are. This is just to visualize where the points are for some quick validation. #Geodist install stata series#Thank you very much.I am graphing a series of GPS points using twoway scatter in Stata. As I am not comfortable with coding programs in Stata, I am not sure what I would need to change to get the variable name, stored in e(depvar) after pwmean, in the row names. Since the row name ends up being "eated" instead of the variable name, esttab does not put these next to each other, but instead puts the results of pwmean down below mean. I need the variable name in the row name, so I can successfully append the results of pwmean, with the results of mean, in a single table with one row per variable. For example, when I use pwmean \var', over(treated)` the column name becomes "eated" and the variable name ends up in the column name. It works well with some of the commands I use, like mean, but some other commands end up with not having the row and column names I would like. I am using Ben Jann's "appendmodels" program to present a table with different models who don't naturally end up in the same table. I have already posted this question to Statalist here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |