From the course: Introduction to Stata
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Manipulating data: Solution - Stata Tutorial
From the course: Introduction to Stata
Manipulating data: Solution
(upbeat music) - [Instructor] Let's have a look at the solution Stata data manipulation challenge. Our first challenge was to create a new variable that identifies all married, non-white women, aged 40 or above. So, let's go ahead and load up the data, and see what we can do. We've loaded the NLSW88 data, so, let's do a quick describe to see what variables we might need for the first challenge, describe. Doing that describe the data shows us that the following variables are likely to be of interest to us, age, race, and married. Let's look at each in turn before we set up our code. So, let's tabulate age. Age looks fairly straightforward. This is a continuous variable so, we just need to ensure that we use the right cut-off point. Now, let's look at race, tabulate race. Okay, so, we have two non-white categories, black and other. However, before we continue, we need to identify the numerical values behind the labels.…
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)
-
-
-
-
-
-
-