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
Heat maps according to datesDear friends, I am interested in build the attached graph. I was exploring in stata with several com…
Interpreting coefficients in ologit regressionsDear everyone, I am a bit confused in interpreting the coefficients in an ologit regression when bo…
IV 2SLS when dependent variable in 1st stage differs from endogenous variable in 2nd stageDear All, I am trying to implement on Stata 14.0 the same model adopted in Remolona, Scatigna and W…
query about stata codeHello, I would like to confirm whether I generate a variable in a proper way. The definition is as f…
Fixed Effects Model with Time Invariant Independent VariablesI am working with a panel data set in Stata 16.1 that has 14,690 observations and 19 variables. I am…
Subscribe to:
Post Comments (Atom)
0 Response to Smap: connect points if fullfill a criteria
Post a Comment