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

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…

Contents