From the course: Introduction to Stata
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Merging and appending - Stata Tutorial
From the course: Introduction to Stata
Merging and appending
- [Instructor] In this session, we're going to ask ourselves the question, how can we merge two or more data sets together in Stata? Combining data sets is a common feature of data analysis, and imagine that you have multiple data sets, and you want to combine these. How can we combine these in Stata? It's actually very simple to do in Stata, and Stata will not give you any problems even when merging extremely large data sets in the gigabyte range. However, from experience, I've noticed that mistakes are often the result of a lack of understanding of what exactly is being combined, and what the intended outcome is. The key commands that we're going to introduce in this session are append and merge. Append appends data sets, whilst merge merges them. Let me explain to you the difference in the next two slides. Append adds observations to existing variables. Imagine that we have two data sets, the master data set and the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Recoding an existing variable4m 3s
-
(Locked)
Generating a new variable5m 15s
-
(Locked)
Naming and labeling variables5m 20s
-
(Locked)
Extended generate3m 26s
-
(Locked)
Indicator variables4m 7s
-
(Locked)
Keeping and dropping variables3m 9s
-
(Locked)
Saving data3m 6s
-
(Locked)
Merging and appending6m 54s
-
(Locked)
String variables5m 53s
-
(Locked)
Local macros and looping7m 12s
-
(Locked)
Manipulating data: Challenge45s
-
(Locked)
Manipulating data: Solution4m 7s
-
(Locked)
-
-
-
-
-
-
-