I have three datasets (A,B, and C), which all datasets have the Year, State, Index variables. The Year and State are the same in three datasets, but the Index1 is in A, the Index2 in B, and the Index3 in C. I would like to merge three datasets.
I was able to merge three datasets with this code:
use A, clear
merge 1:1 Year State using B
drop _merge
merge 1:1 Year State using C
drop _merge
save data_merged
Is there any way I can merge multiple datasets together?
Many thanks!
I was able to merge three datasets with this code:
use A, clear
merge 1:1 Year State using B
drop _merge
merge 1:1 Year State using C
drop _merge
save data_merged
Is there any way I can merge multiple datasets together?
Many thanks!
Comment