From the course: Introduction to Stata
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Extended generate - Stata Tutorial
From the course: Introduction to Stata
Extended generate
- [Instructor] In this session, we'll look at extended generate which is a more advanced version of generate. Status generate and replace commands are without doubt some of the most often used data commands. But what if you have complex variables to create, and both commands either require you to use a lot of code or can't help you at all? For example, say you wanted to generate deciles from a continuous variable. Using generate and replace means you would need to type at least ten different lines of code. Or, say you want to compute row means for every observation. Well generate and replace can only compute column means, so that would be a bit of a problem. This is where the Egen command comes in. Egen stands for: Extension to Generate and is designed to simplify more complex data manipulations. In this session I'll show you two examples, so let's head off to Stata. And here we are with the auto data already loaded. Before we continue, it's worth taking a look at Egen's help file. So…
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)
-
-
-
-
-
-