Regression.Studio

Interactive visualizations, R programming resources, and references designed to accompany the methods covered in HPM 543. Materials are organized by type and can be used independently or alongside course sessions.

R Resources


R & RStudio Quickstart Guide
Installation, packages, libraries, file types, and getting started with R
Quick Reference
Quick-reference tables for base R, dplyr, ggplot2, tidyverse, and external PDF cheat sheets
Regression in R: A Reference
Common regression commands, model specification, and output interpretation
Mixtape Syntax Translations
Translations of applied examples from Cunningham's The Mixtape from Tidyverse to Base R and data.table syntax

Visualizations: Regression Fundamentals


Interactive
OLS: Single Variable
Minimizing the sum of squared errors with one predictor
Interactive
OLS: Multiple Variables
Extending OLS to multiple predictors
Interactive
3D Regression Plane
Visualizing the regression surface with two predictors
Interactive
SSE vs SAE
Comparing sum of squared errors and sum of absolute errors
Interactive
Least Squares Animated
Step-by-step animation of the OLS minimization process
Interactive
Indicator Variables and Interactions
How categorical variables enter the regression model
Group 0 Group 1
Interactive
Simple Group Indicator
How a 0/1 predictor shifts the regression line to compare two groups
β̂₀ β̂₁x₁ β̂₂x₂
Interactive
Linear Model Decomposition
Decompose fitted values into predictor components; builds intuition for partial regression and Frisch-Waugh-Lovell

Visualizations: Diagnostics and Extensions


Interactive
Collinearity Bands
How multicollinearity affects coefficient estimation and confidence bands
marginal vs. partial
Interactive
Controlling for a Variable
How correlated predictors change partial vs. marginal slopes
Sigmoid NLL Surface
Interactive
Logistic Regression: Full MLE
Negative log-likelihood surface and maximum likelihood estimation

Visualizations: Causal Inference


cutoff
Interactive
Regression Discontinuity
Bandwidth selection, polynomial fit, and local ATE estimation at the cutoff
intervention
Interactive
Interrupted Time Series
Pre/post treatment effect estimation with trend adjustment
Treated Control
Interactive
Matching Strategies
Comparing propensity score, caliper, and coarsened exact matching
ATE ATT Treated Control
Interactive
ATE vs ATT
Average treatment effect vs treatment effect on the treated; selection bias and overlap
C X Y
Game
Confounding Game
Identify backdoor paths and valid adjustment sets in directed acyclic graphs

R Syntax Translations


Chapter-by-chapter R translations for the statistical methods and examples in both course texts. Each guide maps concepts to working R code, with tabs for multiple dialects where available.

Impact Evaluation in Practice (Gertler et al.)

Chapter 3
Causal Inference and Counterfactuals
Chapter 4
Randomized Control Trials
Chapter 5
Instrumental Variables
Chapter 6
Regression Discontinuity
Chapter 7
Difference-in-Differences
Chapter 8
Matching and Propensity Scores

Causal Inference: The Mixtape (Cunningham)

Chapter 2
Probability and Regression Review
Chapter 4
Potential Outcomes Causal Model
Chapter 9
Difference-in-Differences

MiniViz / Widgets


Counterfactual Effect Estimator OLS Minimization Three Views of Causal Reality ATE, ATT, and Selection Bias

Studio


Coming Soon
An interactive workspace for building and testing regression models