Hi all,
I have already posted this below a (old) thread, but re-post it here as I did not receive a response.
I am new to smap and am trying to map villages (level=0) and cities (level=1) on a map and connect the points with a line in case the two levels share the same ID (meaning that a person goes both to the village and the city). In the example below, I would want a line connecting the 4th and 35th observation, for example. There could be a point that needs to be connected with several others.
The data looks like this:
+--------------------------------------+
| level latitude longitude ID |
|--------------------------------------|
1. | 0 14.8984 -16.5432 102 |
2. | 0 14.9084 -16.4556 103 |
3. | 0 14.7076 -16.0167 103 |
4. | 0 15.3681 -16.1361 102 |
34. | 1 14.941592 -16.490471 101 |
35. | 1 14.941592 -16.490471 102 |
So far, I am merging this data to data generated from a shapefile and plot the points using smap.
use corr.dta, clear
merge 1:m id using data", nogen
spmap Shape_Area using coord0.dta, id(id) fcolor(white) point(xcoord(longitude) ycoord(latitude) by(level) fcolor(Blues) legenda(on)) legend(size(medium) position(1))
Now, as I said, I am struggling with getting the lines to connect observations that share the same ID.
Do you have any advice on how to do this? Thank you very much in advance,
Best,
Marlene
Related Posts with Smap: connect points if fullfill a criteria
Effect of Endogeneity on SignificanceDear Statalist, I have a fairly simple doubt, forgive me if it's rather basic, but I was wondering …
Problem with command "reshape" (Stata 14)I have used the command "reshape" for years very frequently. However, when I tried to ran it again t…
Testing correlation of two variables with many variablesHi I have the following variables drought_rp, flood_rp, *_rms *_rms represents 50 variables with _rm…
How to test if the sum of two parameters are zero when we use mlogit command?Hi I want to know how to test if the sum of two parameters are zero in the mlogit context. <Nota…
mixed variance decomposition using nested and crossed panel dataI want to decompose the variation of what I characterize as "concordance scores" by applying the mix…
Subscribe to:
Post Comments (Atom)
0 Response to Smap: connect points if fullfill a criteria
Post a Comment