Stata - How to merge datasets

preview_player
Показать описание
Welcome to my classroom!
This video is part of my Stata series. A series where I help you learn how to use Stata. In this video, we look at how to merge two datasets using the merge command in Stata. We look at one-to-one and one-to-many merging.

Note: What I show here is my take on the topic. I would be happy to receive comments!

Useful links:
Рекомендации по теме
Комментарии
Автор

Thanks from France ! it has been useful !

loancet
Автор

Thanks it's helpful, we hope you would show us how tu use our single data from excel or from data stored out of stata for example... because this is the most used type I guess ! Thanks again (y)

frikhatomar
Автор

Thanks for your videos.
I have a problem with merge I won't to merge 1:1 sam key variable . At all I have 7 dataset I like to merge. I get error says variable _merge already defined stata. How can we solve that problem?

alihussien
Автор

Hi Steffen, thanks a lot. I have a doubt. I have two datasets, one contains individual-level obs (var is idno) and the other has political parties as obs (string var is party). Both parties and individuals are nested in countries. The only var in common is indeed country, yet does not uniquely identify the obs. I would like to merge the two, by generating multiple obs for each idno in the master dataset corresponding to each idno-party pair in the same country. Unfortunately I'm stuck. Shall I create another variable to merge the two? Thanks a lot

NathanCats
Автор

Stata automatically copy the original observation data when we do the 1:many. How make to NOT copy? Or, how to treat this additional observation (added after merging) as missing data?

proguifreccia