Stata to R maps Stata commands for econometric workflows to R equivalents, using datasets from Wooldridge’s Introductory Econometrics. It covers data exploration, variable manipulation, model estimation, and postestimation, with notes on key differences between the two environments.
What’s covered#
- Setup – installing the
wooldridgepackage and loading datasets - Basic plots – histogram, scatter plot, fitted line, and boxplot
- Summarize data –
browse,describe,summarize,tabulateequivalents - Create and edit variables – generating, dropping, keeping, recoding, and creating dummies
- Estimate models: OLS –
lm, robust and clustered standard errors viaestimatr - Estimate models: MLE – logit, probit, and tobit regression
- Estimate models: panel/longitudinal – fixed effects with
plm - Estimate models: instrumental variables (2SLS) –
ivregfrom the AER package - Postestimation –
predict, residuals, and diagnostic tests