Hello Everyone,
I am trying to merge two different datasets. Each dataset has two columns (example dataset 1: countryID and fdi_out_1970m.dta , example dataset 2: countryID and aid_out_1970m.dta).
The dataset with aid_out_1970m.dta has 12 more variables than fdi_out_1970m.dta because it includes the summary of different world region and fdi_out_1970m.dta just has the country names and no regions.
I previously merged the countryID with aid_out_1970 and fdi_out_1970 and got the results (fdi_out_1970m.dta and aid_out_1970m.dta). Now I am trying to merge together aid_out_1970m.dta with fdi_out_1970m.dta. But every time I try to merge the two datasets together I get factor-variable and time-series operators not allowed.
Here is the code I tried:
use "/Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 AID MERGE/aid_out_1970m.dta", clear
generate id = _n
tempfile aid
use "/Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 FDI MERGE/fdi_out_1970m.dta", clear
generate id = _n
merge 1:1 aid_out_1970m.dta using fdi_out_1970m.dta
I also previously tried this code:
merge 1:1 "/Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 AID MERGE/aid_out_1970m.dta" using /Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 FDI MERGE/fdi_out_1970m.dta, clear
ANY HELP WOULD BE MORE THAN APPRECIATED! THANK YOU FOR YOUR TIME
I am trying to merge two different datasets. Each dataset has two columns (example dataset 1: countryID and fdi_out_1970m.dta , example dataset 2: countryID and aid_out_1970m.dta).
The dataset with aid_out_1970m.dta has 12 more variables than fdi_out_1970m.dta because it includes the summary of different world region and fdi_out_1970m.dta just has the country names and no regions.
I previously merged the countryID with aid_out_1970 and fdi_out_1970 and got the results (fdi_out_1970m.dta and aid_out_1970m.dta). Now I am trying to merge together aid_out_1970m.dta with fdi_out_1970m.dta. But every time I try to merge the two datasets together I get factor-variable and time-series operators not allowed.
Here is the code I tried:
use "/Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 AID MERGE/aid_out_1970m.dta", clear
generate id = _n
tempfile aid
use "/Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 FDI MERGE/fdi_out_1970m.dta", clear
generate id = _n
merge 1:1 aid_out_1970m.dta using fdi_out_1970m.dta
I also previously tried this code:
merge 1:1 "/Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 AID MERGE/aid_out_1970m.dta" using /Users/an-nourazen-nabcompaore/Dropbox/AnNoura/build/code/STEP 2 FDI MERGE/fdi_out_1970m.dta, clear
ANY HELP WOULD BE MORE THAN APPRECIATED! THANK YOU FOR YOUR TIME
Comment