Hello everyone!
For my master-thesis at the Erasmus University Rotterdam in The Netherlands, I have a large data-set (45455 rows and 7755 unique ID’s in total) containing information on corporate owners and their subsidiaries with the geographic coordinates for every subsidiary.
I want to create a new variable for every corporate owner containing the mean difference in geographic location of its subsidiaries relative to each other (so between each pair among all possible pairs of its subsidiaries for every corporate owner separately), to then use this as independent variable in a regression.
On the web I found "writing a loop by installing and using a related user-written command from SSC, -geonear-" could be helpful for me.
Unfortunately, I really don’t know how to do this. Does someone maybe see a solution to this problem? It would mean a lot!
Here is a data example:
Thanks a lot in advance. Kind regards, Joost Koning
For my master-thesis at the Erasmus University Rotterdam in The Netherlands, I have a large data-set (45455 rows and 7755 unique ID’s in total) containing information on corporate owners and their subsidiaries with the geographic coordinates for every subsidiary.
I want to create a new variable for every corporate owner containing the mean difference in geographic location of its subsidiaries relative to each other (so between each pair among all possible pairs of its subsidiaries for every corporate owner separately), to then use this as independent variable in a regression.
On the web I found "writing a loop by installing and using a related user-written command from SSC, -geonear-" could be helpful for me.
Unfortunately, I really don’t know how to do this. Does someone maybe see a solution to this problem? It would mean a lot!
Here is a data example:
Code:
dataex ID_x CompanynameLatinalphabet Noofsubsidiaries SubsidiaryName Latitude Longitude in 8235/8248
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str4 ID_x str199 CompanynameLatinalphabet str4 Noofsubsidiaries str199 SubsidiaryName str18(Latitude Longitude) "211" "DOW BENELUX B.V." "3" "TERNEUZEN PARTNERSHIP SERVICES B.V." "51.3088989257812" "3.77801609039306" "211" "DOW BENELUX B.V." "3" "VALUEPARK TERNEUZEN BEHEER B.V." "51.3371200561523" "3.82822895050048" "211" "DOW BENELUX B.V." "3" "POLYOL BELGIUM" "51.1929359436035" "4.42132902145385" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "BOEHRINGER INGELHEIM ANIMAL HEALTH INTERNATIONAL GMBH" "49.975830078125" "8.065308570861809" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "BOEHRINGER INGELHEIM ANIMAL HEALTH PARTICIPATIONS GMBH" "49.975830078125" "8.065308570861809" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "BOEHRINGER INGELHEIM VETERINARY RESEARCH CENTER GMBH & CO. KG" "49.975830078125" "8.065308570861809" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "BOEHRINGER INGELHEIM VRC GMBH" "49.975830078125" "8.065308570861809" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "BOEHRINGER INGELHEIM ANIMAL HEALTH FRANCE" "not found" "not found" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "BOEHRINGER INGELHEIM ANIMAL HEALTH ITALIA S.P.A., IN BREVE BOEHRINGER INGELHEIM AH IT S.P.A." "45.4636192321777" "9.18811607360839" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "BOEHRINGER INGELHEIM ANIMAL HEALTH JAPAN CO. LTD" "35.6869621276855" "139.749465942382" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "MERIAL BARCELONETA LLC" "18.45068359375" "-66.5386276245117" "212" "BOEHRINGER INGELHEIM VETMEDICA GESELLSCHAFT MIT BESCHRAENKTER HAFTUNG" "9" "MERIAL SAUDE ANIMAL LTDA" "-23.5506515502929" "-46.6333808898925" "213" "BASF ITALIA S.P.A." "6" "BASF COATINGS SERVICES ITALY S.R.L." "45.6282539367675" "9.146426200866699" "213" "BASF ITALIA S.P.A." "6" "NUNHEMS ITALY SOCIETA' A RESPONSABILITA' LIMITATA, O IN FORMA ABB REVIATA NUNHEMS ITALY S.R.L." "44.6651649475097" "11.1350002288818" end
Thanks a lot in advance. Kind regards, Joost Koning
Comment