Instrumental Variables and Creating and Modifying Variables
Overview
1
Instrumental Variables
1.1
Estimating Returns to Education for Married Women
1.2
Exercise: Estimating Returns to Education for Men
1.3
Smoking on Birthweight
1.4
Estimating Returns to Education for Married Women Part 2
2
Testing Assumptions
2.1
Testing for Endogeneity - Returns to Education for Working Women
2.1.1
Manually Test
2.1.2
Using estat endogenous
2.2
Testing Overidentifying Restrictions
2.2.1
Manually Test
2.2.2
Estat overid
3
Creating Variables
3.1
Creating and changing variables
3.1.1
Generate command
3.1.2
Replace
3.2
Numeric expressions and functions
3.2.1
Random Numbers and setting seeds
3.3
String Expressions and functions
3.3.1
substr functions
3.4
Recoding
3.4.1
Recoding with categorical variables
3.4.2
Recoding with continuous variables
3.4.3
Recoding values to missing
3.5
i.
Operator
3.5.1
Creating Binary and Categorical variables
3.6
Interactions
3.6.1
Categorical-Categorical Interaction - Changes Intercepts
3.6.2
Categorical-continuous - changes intercepts and slopes
3.6.3
Continuous-Continuous Interaction - add n polynomials
3.7
Date Variables
3.7.1
Create Dates from numerical variables
3.7.2
Create Dates from string variables
3.7.3
Calculate differences between dates
3.7.4
Return day, month, or year from a date variable
3.8
Date and Time Variables
3.9
Computations across variables
3.10
EGEN Computation across observations
3.10.1
Subscripting
3.10.2
More Egen
3.11
Converting Strings to numerics
3.11.1
Destring
3.11.2
Encode
3.11.3
Converting numerics to strings
3.12
Renaming and reordering
3.12.1
Rename
3.12.2
Order
References
Published with bookdown
Instrument Variables and Creating Variables
Instrument Variables and Creating Variables
Samuel Rowe
2025-09-17
Overview
Instrumental Variables
Creating and Modifying Variables (Mitchell Chapter 6)
Adapted from Mitchell (2020) and Wooldridge (2009)