EC421 Lab Notes - Winter 2020
Here you can find lab notes and resources for Ed Rubin’s EC421 Winter 2020 course. These will be updated weekly after lab. These notes are not a substitute for attending lab but serve as an additional resource.
Useful R Resources
Lab Notes
- Lab One: Introduction
- An introduction to objects, functions, classes, and mathematical operations. An introduction to the tidyverse dplyr functions such as filter, mutate, etc. A brief review of OLS regression.
- Problem Set 1 Help: Code
- Code that will be useful for completing problem set 1. The assignment and dataset are available on the course Canvas page.
- Lab Two: Introduction to ggplot
- An introduction to making plots in R with the ggplot2 package. Lab notes set up the basics of ggplot and then show some more sophisticated graphs made using data from the Tidy Tuesday repo.
- Lab Three: Heteroskedasticity
- Testing for heteroskedasticity and running regressions with heteroskedastic-robust standard errors. Code covers the Goldfeld-Quant Test, Breusch-Pagan Test, and the White Test.
-
Lab Four: Midterm Review
- Lab Five: Functions and Time Series
- Writing functions in R. Time Series simulation and plotting.
- Lab Six: Dynamic Models and Autocorrelation
- Estimating static and dynamic time series models. We estimate models with both lagged explanatory variables and lagged outcome variables and consider the implications for OLS. Visual inspection of autocorrelation using ggplot.
- Lab Seven: Instrumental Variables
- Introduction to the instrumental variables approach. Motivate IV with an example and introducing 2SLS. We then implement 2SLS in R.
- Problem Set 4 Help: Code
- Walks through how to formally test for third order autocorrelation using a Breusch-Godfrey test.