---
title: "Resources"
subtitle: "Software, packages, and references"
---
## R and RStudio
All work in this course uses **R** and **RStudio Desktop**.
| Software | Download |
|----------|----------|
| R (≥ 4.3.0) | [cran.r-project.org](https://cran.r-project.org) |
| RStudio Desktop | [posit.co/download/rstudio-desktop](https://posit.co/download/rstudio-desktop) |
| Quarto (for assignments) | [quarto.org](https://quarto.org) |
---
## Required Packages
Install all required packages in one go:
```r
pkgs <- c(
# Data manipulation & visualisation
"tidyverse", # dplyr, ggplot2, tidyr, purrr, readr, stringr
"patchwork", # combine ggplot panels
"GGally", # ggpairs and correlation plots
# Econometric modelling
"broom", # tidy model output (tidy, glance, augment)
"modelsummary", # publication-quality regression tables
"car", # linearHypothesis, vif, Anova
"lmtest", # bptest, dwtest, bgtest, coeftest
"sandwich", # vcovHC, vcovHAC (robust variance-covariance)
"estimatr", # lm_robust (one-step robust estimation)
# Datasets
"wooldridge", # Wooldridge textbook datasets
"gapminder", # Gapminder global development data
"AER", # Applied Econometrics with R datasets
# Time series
"tseries", # adf.test, kpss.test
"dynlm", # dynamic linear models with lm() syntax
"zoo", # irregular time series
"tsibble", # tidy time series structures
"feasts", # time series features and ACF/PACF plots
"fabletools" # tidy forecasting framework
)
install.packages(pkgs)
```
---
## Package Reference
### Core Workflow
| Package | Key Functions | Use |
|---------|--------------|-----|
| `dplyr` | `filter`, `select`, `mutate`, `summarise`, `group_by` | Data wrangling |
| `ggplot2` | `ggplot`, `aes`, `geom_*`, `labs`, `theme_*` | Visualisation |
| `broom` | `tidy()`, `glance()`, `augment()` | Tidy model output |
| `modelsummary` | `modelsummary()`, `datasummary()` | Regression tables |
### Inference and Diagnostics
| Package | Key Functions | Use |
|---------|--------------|-----|
| `car` | `linearHypothesis()`, `vif()` | Joint tests, multicollinearity |
| `lmtest` | `coeftest()`, `bptest()`, `dwtest()`, `bgtest()` | Coefficient tests, diagnostics |
| `sandwich` | `vcovHC()`, `vcovHAC()`, `NeweyWest()` | Robust variance estimators |
| `estimatr` | `lm_robust()` | Robust regression in one call |
### Datasets
| Package | Key Datasets | Topic |
|---------|-------------|-------|
| `wooldridge` | `wage1`, `hprice1`, `vote1`, `phillips`, `hseinv` | Core examples |
| `gapminder` | `gapminder` | International development |
| `AER` | `CPS1985`, `Fertility` | Labour economics |
| `datasets` | `cars`, `longley` | Base R examples |
### Time Series
| Package | Key Functions | Use |
|---------|--------------|-----|
| `dynlm` | `dynlm()` | Dynamic regression with lag operators |
| `tseries` | `adf.test()`, `kpss.test()` | Unit root tests |
| `zoo` | `zoo()`, `rollmean()` | Time series objects |
| `feasts` | `ACF()`, `PACF()`, `autoplot()` | Tidy ACF/PACF |
---
## Starter Script
Copy this block at the top of every R session or Quarto document:
```r
library(tidyverse)
library(broom)
library(modelsummary)
library(lmtest)
library(sandwich)
library(estimatr)
library(car)
library(wooldridge)
# Consistent ggplot theme
theme_set(theme_minimal(base_size = 13))
options(digits = 4, scipen = 999)
```
---
## Cheat Sheets
- [dplyr cheat sheet](https://rstudio.github.io/cheatsheets/data-transformation.pdf)
- [ggplot2 cheat sheet](https://rstudio.github.io/cheatsheets/data-visualization.pdf)
- [R Markdown / Quarto cheat sheet](https://rstudio.github.io/cheatsheets/quarto.pdf)
---
## Textbooks
| Book | Authors | Notes |
|------|---------|-------|
| *Introductory Econometrics* (6th ed.) | Wooldridge | Primary text. Datasets in the `wooldridge` R package. |
| *Introduction to Econometrics* (4th ed.) | Stock & Watson | Alternative reference. Emphasises inference. |
| *Principles of Econometrics* (4th ed.) | Hill, Griffiths & Lim | Applied focus with R/EViews coverage. |
| *Using R for Introductory Econometrics* (2nd ed.) | Heiss | Free online at [urfie.net](http://urfie.net). R code for Wooldridge examples. |
---
## Getting Help
- **R documentation**: Type `?function_name` in the console, e.g. `?lm`
- **Package vignettes**: `vignette("modelsummary")` or `browseVignettes("broom")`
- **Stack Overflow**: tag your question `[r]`
- **Posit Community**: [community.rstudio.com](https://community.rstudio.com)