Hello Satalist,
I need to merge two datasets. I am matching them with two variables 1. 'country_id' and 2. 'year'. The first dataset has one observation pr. year for each country_id. The other has cases of multiple observations pr year for some countries.
The dataset with multiple observations records regimes , where there sometimes are more than one pr year, while the other just has general country data.
Here is an example:
input long(country_id year) str29 country_name3
3 1905 "Mexico"
3 1906 "Mexico"
3 1907 "Mexico"
3 1908 "Mexico"
3 1909 "Mexico"
3 1910 "Mexico"
3 1911 "Mexico"
3 1911 "Mexico"
3 1911 "Mexico"
3 1912 "Mexico"
3 1913 "Mexico"
3 1913 "Mexico"
3 1914 "Mexico"
3 1914 "Mexico"
The other dataset just has the one observation pr year.
I would like to know if it is at all possible to create matching multiple observations in the other dataset, with the same values on all variables as the original observation pr. year? I would very much like to avoid having to delete my duplicates.
I hope my question is clear. Thanks in advance.
I need to merge two datasets. I am matching them with two variables 1. 'country_id' and 2. 'year'. The first dataset has one observation pr. year for each country_id. The other has cases of multiple observations pr year for some countries.
The dataset with multiple observations records regimes , where there sometimes are more than one pr year, while the other just has general country data.
Here is an example:
input long(country_id year) str29 country_name3
3 1905 "Mexico"
3 1906 "Mexico"
3 1907 "Mexico"
3 1908 "Mexico"
3 1909 "Mexico"
3 1910 "Mexico"
3 1911 "Mexico"
3 1911 "Mexico"
3 1911 "Mexico"
3 1912 "Mexico"
3 1913 "Mexico"
3 1913 "Mexico"
3 1914 "Mexico"
3 1914 "Mexico"
The other dataset just has the one observation pr year.
I would like to know if it is at all possible to create matching multiple observations in the other dataset, with the same values on all variables as the original observation pr. year? I would very much like to avoid having to delete my duplicates.
I hope my question is clear. Thanks in advance.
Comment