Saturday, October 24, 2020

Analyzing Donut Consumption in Springfield

 Michael Bailey's econometrics textbook Real Econometrics begins in Chapter 1 with a small, 13-person data set consisting of characters from the Simpson's animated series (Homer, Marge, Comic Book Guy...). Although the variables are limited to weight and donut consumption (we can also infer gender from the names) it turns out one can use these data set to illustrate many of the core econometric techniques taught in an introductory, undergraduate econometrics course.

I've created two R scripts that contain code examples illustrating these fundamental techniques (such as displaying and summarizing data, calculating and comparing averages, bivariate and multivariate regressions with binary and continuous variables, nonlinear models, and producing tables and figures for use in word processing programs) all using Bailey's Simpsons data. The first one here is intended as an introduction and to help brand new students get started. The second one here illustrates more advanced techniques like nonlinear models and linear probability models. 

The data appears in Table 3 of this document, which is a set of notes and exercises I prepared, that display a lot of the tables created in the scripts. In addition to this document, within R scripts themselves you'll find many comments intended to help the user understand what the code is doing.

An instructor using Bailey's textbook can find more R resources created by Tony Carilli here. His approach to using R is slightly different than mine (mainly in that I don't use of the tidyverse package) but his code and resources are very well done.

Instructors may be interested in other R scripts I've written for this class, which follow the same approach to using R as you'll find in my two R scripts linked to above. Another two R scripts I wrote are here and are intended to be used in conjunction with Angrist and Pishke's Mastering Metrics. I have also prepared exercises and notes to go along with these R scripts. I have also created over a dozen R scripts that analyze the American Community Survey microdata (an excellent data source for student term papers!) and these are intended to be used in conjunction with my forthcoming book, Data and the American Dream.)

1 comment: