Hi,
I am trying to create a centroid over a couple of observations by group_ID and my dataset looks like this:
I have around 60k groups and 9 million observations. My final output should be a new variable (or two) which take on the values for the centroid for that given group. I tried using the centroid command but it did not work due to r(134) too many values. If it is possible to choose from different distance measures, I would prefer Euclidean distance. Any ideas on how I might be able to create that?
Thanks!
I am trying to create a centroid over a couple of observations by group_ID and my dataset looks like this:
Code:
latitude longitude group_ID -10.23 25.24 1 15.34 67.45 2 -67.45 32.34 2 12.45 -87.12 2 85.34 -34.53 1 77.77 -23.34 2 -56.78 56.78 1 -89.44 34.34 2 -23.45 67.89 1
Thanks!
Comment