Links to section notes and relevant files.

Note: I’ve updated the web-format (HTML) files, so they should run. The attached PDFs and ZIPs remain as they were in spring 2017.

These notes (and I) owe a lot to previous GSIs for this class: Fiona Burlig, Kenny Bell, Patrick Baylis, and Dan Hammer.

#### Section 0: Setting up R

Install R, RStudio, and other relevant programs; resources for R; general suggestions for coding.

#### Section 1: Getting started with R

Learning the basics of R: installing and loading packages; loading various data types (haven and readr); basic data summarization and manipulation (introduction to dplyr).

Vectors, matrices, and general mathematical usage of R.

#### Section 3: Functions and loops

Writing your own (OLS) functions, using loops, and running simulations in R.

#### Section 4: FWL and model fit

Logical operators, optional arguments to your custom functions, Frisch-Waugh-Lovell (FWL) theorem, omitted variable bias, and measures of fit/overfitting.

#### Section 5: Inference and parallelization

Statistical inference via hypothesis testing: t tests and $$F$$ tests. Plus simulation and parallelization.

#### Section 6: Figures with ggplot2

Creating informative and aesthetically figures using R’s ggplot2—scatter plots, histograms, density plots, and more.

#### Section 7: GLS and WLS

Generalized least squares (GLS), weighted least squares (WLS), and more simulations!

#### Section 8: OLS in asymptopia

OLS as $$N$$ gets (very) big. Also: simulations, coding efficiency, and new ggplot2 techniques.

#### Section 9: Standard errors, Vol. I

Calculating standard errors via analytical methods and via the Delta Method. Includes linear and nonlinear combinations of parameters. Plus making prettier tables.

#### Section 10: Standard errors, Vol. II

Calculating standard errors in various situations: spherical errors, heteroskedastic errors, temporally correlated errors, spatially correlated errors, clustered errors.

#### Section 11: Instrumental variables

Instrumental variables (IV) and two-stage least squares (2SLS). Plus measurement error.

#### Section 12: Spatial data

Spatial data. Shapefiles, points data, maps, and—more generally—R as a GIS.

#### Section 12b: Spatial data, continued

Spatial data. Rasters, geocoding, and mapping in R.

#### Section 13: Introduction to data.table

An introduction to the data.table package (useful for working with large datasets).

#### Supplement 1: LaTeX and knitr

Introductions to and resources for LaTeX and knitr.