Stata - How to merge datasets

  Рет қаралды 17,925

Steffen's Classroom

Steffen's Classroom

Күн бұрын

Пікірлер: 20
@OmirserikAkhmetov-db4ko
@OmirserikAkhmetov-db4ko 2 ай бұрын
Thanks from China. Its nice work and please keep developing. Amazing)))
@loancet1878
@loancet1878 3 жыл бұрын
Thanks from France ! it has been useful !
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
Happy that is helped!
@mashai1161
@mashai1161 9 ай бұрын
helps a lot! Thank you!
@ImtiazAli-dc7yd
@ImtiazAli-dc7yd 10 ай бұрын
its very much helpful. thanks
@frikhatomar6426
@frikhatomar6426 11 ай бұрын
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)
@SteffensClassroom
@SteffensClassroom 11 ай бұрын
Hi! Thank you for the comment. To solve this, you first import your file and then save it as a .dta (Stata format), and then you proceed as shown in the video :)
@alainfav9278
@alainfav9278 Жыл бұрын
Thanks. It's really helpful
@alihussien7935
@alihussien7935 11 ай бұрын
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?
@SteffensClassroom
@SteffensClassroom 11 ай бұрын
After each separate merge, you need to drop the _merge variable that is automatically generated.
@alihussien7935
@alihussien7935 11 ай бұрын
@@SteffensClassroom okay but I will still keep the merge it variables? It's word drop that's scare me, 😅 it will not deleting the already mergeit variables?
@SteffensClassroom
@SteffensClassroom 11 ай бұрын
​@@alihussien7935 If you just only drop this one variable, then you are running into any trouble. Check out the keep/drop video if you need some additional help.
@alihussien7935
@alihussien7935 11 ай бұрын
@@SteffensClassroom okay I will do, thanks a lot for your kindness and help
@NathanCats777
@NathanCats777 Жыл бұрын
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
@SteffensClassroom
@SteffensClassroom Жыл бұрын
I would assume that for instance you know which political party each individual belongs to, or at least something that can tie this all together. You would have to make a 1:m merge (see merge help file). Don't forget to change the string variable to numeric ( you can use encode here).
@NathanCats777
@NathanCats777 Жыл бұрын
@@SteffensClassroom Thanks a lot!
@proguifreccia
@proguifreccia 3 жыл бұрын
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?
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
Of I am not mistaken, you can use the _merge variable that is automatically created when using merge. You can then use a keep/drop command to only keep the observations you want. So of you o ly want to keep the observations that appear in both datasets, you use keep if _merge==3. I hope this helps!
@emtiazhossainhritan3439
@emtiazhossainhritan3439 3 жыл бұрын
Thanks a lot.
@SteffensClassroom
@SteffensClassroom 3 жыл бұрын
You're welcome!
Stata Tutorial: Intro Data Cleaning with Panel Data
22:07
Mike Jonas Econometrics
Рет қаралды 42 М.
Stata - How to append datasets
6:58
Steffen's Classroom
Рет қаралды 12 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Stata - Keep/Drop and Missing values
5:13
Steffen's Classroom
Рет қаралды 29 М.
How to Merge (combine) Data in Stata
21:52
The Data Hall
Рет қаралды 5 М.
Merging Datasets in Stata
19:43
Michelle Benson
Рет қаралды 22 М.
Stata Lecture 16: How to Merge datasets and what can go wrong?
9:10
Bram van der Kroft
Рет қаралды 6 М.
How to merge data in Stata | Combining datasets in Stata
15:21
The Data Hall
Рет қаралды 20 М.
Stata - How to use tsset
8:46
Steffen's Classroom
Рет қаралды 11 М.
How do I merge DataFrames in pandas?
21:49
Data School
Рет қаралды 159 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН