Hi Statalisters
I am working on merging two data set with quite different structures, although they have a common id. I want to plot maps in R, but I'm doing the data management in Stata.
I have a map data set with an id for Norwegian counties with their longitude and latitude.
I have another data set with the data of interest for the plots with an id coded identically to the map data set. This is panel data at county level for both genders, boys and girls separately, and at different age groups over several years.
Although the data sets have a common id, the data structure is quite different, so merging the two data sets is not straight forward to me.
Map data set:
Data of interest to visualize:
I've tried both:
and
I would appreciate any input on how I may solve this issue.
I am working on merging two data set with quite different structures, although they have a common id. I want to plot maps in R, but I'm doing the data management in Stata.
I have a map data set with an id for Norwegian counties with their longitude and latitude.
I have another data set with the data of interest for the plots with an id coded identically to the map data set. This is panel data at county level for both genders, boys and girls separately, and at different age groups over several years.
Although the data sets have a common id, the data structure is quite different, so merging the two data sets is not straight forward to me.
Map data set:
Data of interest to visualize:
I've tried both:
Code:
. merge 1:m id using "C:~ADHD_merge.dta" variable id does not uniquely identify observations in the master data r(459);
Code:
. merge 1:1 id using "C:~ADHD_merge.dta" variable id does not uniquely identify observations in the master data r(459);
Comment