Variable Transformations

Two of the most basic tasks in data wrangling are creating new variables and changing existing variables, which can be combined as variable transformations. If you’ve been working through the book from the beginning you’ve already done a lot of variable transformations, but this section will teach you how to do more complex transforms.

Variable Transformations With Numeric Data will add to your “bag of tricks” for working with numeric data. You’ll learn some useful functions and commands, and generally gain experience writing Stata code.

Variable Transformation With Hierarchical (Grouped) Data will teach you how to carry our variable transformations on hierarchical, or grouped data. For example, you’ll learn how to calculate a household income, or identify households that contain children. You’ll also learn how to work with panel data.

Two articles in the SSCC Knowledge Base that could have been chapters in this section are Working with Dates and Times in Stata and/or Working with Text Data (Strings) in Stata. They’re not because not all Stata users need them, but if you do, or if you just want to round out your variable transformation skillset, then you should work through them as well.