Session Notes — Econ 326

Session Notes — Econ 326

2026-04-01

Lecture 16 (326_16_did.qmd):

  • Fixed conflation between panel data and repeated cross-sections
  • Clarified that Kiel and McClain (1995) garbage incinerator example is a repeated cross-section
  • Refactored covariates explanation to focus on compositional changes in house age instead of trends
  • Corrected wording for backward trends from baseline (=-1$ to =-2$ and =s$)
  • Added note that individual fixed effects and TWFE event study specifications require panel data
  • Rendered all formats (.html, .pdf, _slides.html)

2026-03-17 (session 4)

Created 326_14_treatment_did.qmd — Lecture 14: Treatment effects and difference-in-differences (new content, no LaTeX source):

  • 36 slides across 3 parts: potential outcomes & treatment effects (slides 1–12), regression with covariates & demeaning trick (slides 13–20), difference-in-differences (slides 21–36)
  • Datasets: jtrain2 (Lalonde NSW experiment) and kielmc (Kiel & McClain incinerator example)
  • Base R figures: regression lines with ATE arrow, DID 4-point diagram, parallel trends diagram
  • Proofread: 0 changes (all 10 passes clean)
  • All 3 output formats: 0 errors, 0 KaTeX errors; PDF 87,426 bytes
  • Updated course page _teaching/2026-01-Econ-326.md with lecture 14 entry

File changes:

  • Created 326_14_treatment_did.qmd (~700 lines)
  • Created PLAN_lecture14_treatment_did.md (plan document)
  • Updated _teaching/2026-01-Econ-326.md — added lecture 14

2026-03-17 (session 3)

Lecture 14 proofreading (326_14_treatment_did.qmd):

  • Pass 3: fixed incomplete clause “The parallel trends assumption illustrated:” → “Illustrating the parallel trends assumption:”
  • Pass 7: converted all 11 $$\begin{aligned}...\end{aligned}$$ blocks to \begin{align*}...\end{align*}; split 7 long single-line display equations across two lines to prevent RevealJS overflow
  • Rendered all 3 formats: 0 errors, 0 KaTeX errors; PDF 87590 bytes

2026-03-17 (session 2)

Lecture 12 language tightening (326_12_mreg_testing.qmd):

  • 14 bullet-point edits: removed filler (“want to”, “continue to”, “the following”), passive→active voice (“was estimated”→”we estimate”), “test that”→”test whether”, “some constants”→”given constants”, reduced repetition of heavy expressions, tightened relative clauses and parallel structures
  • Rendered all 3 formats: 0 errors, 0 KaTeX errors

proofread-326 agent update (.claude/agents/proofread-326.md):

  • Added new Pass 3 (Language tightening) with 10-pattern checklist for wordy constructions
  • Renumbered existing passes 3–9 → 4–10; updated introductory count from 9 to 10 passes

CLAUDE.md update:

  • Updated proofread-326 pass table (9→10 passes, added language tightening row, renumbered)

2026-03-17

File changes:

  • .claude/agents/proofread-326.md — converted from symlink to regular file (same content)
  • .claude/commands/proofread.md — converted from symlink to regular file (same content)
  • .claude/settings.local.json — converted from symlink to regular file (same content, gitignored)

New global files (in ~/.claude/):

  • agents/revealjs-check.md — new 6-pass RevealJS layout auditor agent (YAML & structure, reveal order auto-fix, fenced div integrity, width/margin flags, content overflow flags, compilation & HTML audit)
  • skills/revealjs-check/SKILL.md — thin skill wrapper for /revealjs-check <file> invocation

Testing:

  • Ran revealjs-check on 326_14_dummy.qmd: 0 fixes needed (clean), 19 width/overflow flags
  • Ran revealjs-check on 326_12_mreg_testing.qmd: 0 fixes needed (clean), 11 width/overflow flags
  • Both compilations succeeded with 0 KaTeX errors

Config cleanup:

  • Removed the old symlink-based management of Econ 326 .claude/ files (now regular files in git)

Lecture 12 edits (326_12_mreg_testing.qmd):

  • Removed redundant “Conditional on $\mathbf{X}$,” prefix from items 2–4 on “The model” slide (lines 52, 54, 56) — the math already contains \mid \mathbf{X}
  • Converted long inline normality result on “Testing a single coefficient” slide (line 70) to display math indented under bullet
  • Proofread (9-pass): 3 conditioning fixes (added “conditional on $\mathbf{X}$” to distributional statements on lines 102, 131, 154); 4 $$\begin{aligned}$$\begin{align*} conversions; 1 overflow line break (estimated variance formula, line 172–175)
  • RevealJS check: 0 fixes needed, 10 width flags (long math expressions, no structural issues)
  • Rendered all 3 formats: 0 KaTeX errors, PDF 67KB

2026-03-16

File changes (second session):

  • Modified 326_14_dummy.qmd — fixes for RevealJS reveal order, figure sizing, color emphasis, and width overflow
  • Updated CLAUDE.md — added “RevealJS reveal order (CRITICAL)” conversion rules section; updated proofread-326 Pass 8 description
  • Updated MEMORY.md — added RevealJS reveal order notes

Edits to 326_14_dummy.qmd:

  • Example slide (~line 122): added bullet points explaining variable types (interval, dummy)
  • Single dummy slide (~line 135): replaced abstract $\E{U_i \mid \mathbf{X}}=0$ with explicit conditioning on Female, Educ, Exper, Tenure
  • Color emphasis (~lines 143, 157): added \color{red} to δ₀ in women’s conditional expectation and “Thus” equation
  • Intercept shift figure (~line 184): indented R chunk under parent bullet for correct reveal order; enlarged from 6×4 to 8×5.5
  • Slope shift figure (~line 369): same indentation fix and size increase
  • Log dependent variable (~line 242): indented aligned derivation under “In this case,” bullet
  • Changing base group (~line 280): indented aligned derivation under “Since Male = 1 − Female” bullet
  • Multiple categories (~line 440): added “Recall the ordinal education variable:” bullet and indented math; converted E₁–E₅ definitions from two-column \left\{\begin{array} to single-column \begin{cases}
  • Comparing consecutive groups (~line 480): converted D₂–D₅ definitions from \left\{\begin{array} to \begin{cases}

File changes (first session):

  • Created 326_14_dummy.qmd — new lecture converted from LaTeX 326_15_dummy.tex

Conversion details (LaTeX lecture 15 → QMD lecture 14):

  • Title: “Lecture 14: Dummy variables”
  • 18 slides covering: interval/ordinal/categorical variables, dummy variable definitions, single dummy independent variable, intercept shift, log dependent variable, changing the base group, dummy variable trap, slope shift and interactions, multiple categories
  • Slide 3: Female/Male dummy definitions replaced with Married/Unmarried per plan
  • Slide 4: Textbook table image (tab7-1.tif) replaced with R code using wooldridge::wage1
  • Slide 5: Added tenure definition (“number of years at current firm”)
  • Slide 7: Textbook figure (fig7-1.tif) replaced with R-generated intercept shift plot using base R
  • Slide 11: Added binary gender clarification note
  • Slides 12-13: Stata noconstant syntax replaced with R lm(Y ~ X + 0) / lm(Y ~ X - 1)
  • Slide 15: Textbook figure (fig7-2.tif) replaced with R-generated slope shift plot using base R
  • Slides 19-21 (structural breaks / Chow test): dropped entirely per plan
  • Standard conversion applied throughout: TCIMACRO stripped, color markup → bold, eqnarray* → aligned, etc.
  • Estimated equations formatted with \underset{(se)}{coeff} pattern

Post-conversion refinements:

  • Conditioning notation: replaced 4 instances of E\left(...\right) with \E{...} macro for consistency with other lectures
  • Variable names: wrapped all multi-letter variable names (Wage, Female, Male, Educ, Exper, Tenure, Married, Unmarried, Education, Gender) in \text{...} for upright (roman) rendering
  • Missing subscripts: added _i to log model equation (line 234) and Education definition (line 416)
  • Dummy variable trap slide: changed multicollinearity explanation to “In this dataset, Female+Male=1”
  • User manually changed intercept shift superscripts from ^F to ^W (Women), merged intercept shift heading with figure slide, and simplified dummy variable trap text
  • Slope shift plot: redesigned multiple times; final version uses stylized coefficients (β₀=0.8, δ₀=−0.3, β₁=0.10, δ₁=−0.04), dashed guide lines from y-axis intercepts to labels, “Men”/”Women” line labels, and slope annotation labels offset from lines
  • Example slide plot (with actual estimated coefficients) was added then dropped per user request (slope difference too small to see)

Persistent memory updates:

  • Added convention: conditioning expectations must use \E{...} macro
  • Added convention: multi-letter variable names in math must use \text{...} for upright rendering

Proofreading (3-agent consensus: codex, gemini, opus):

  • Slide titles: split “Interval, ordinal, and categorical variables” into “Interval and ordinal variables” + “Categorical variables”; dropped articles from “A single dummy independent variable”, “An intercept shift”, “The dummy variable trap” (×2) for consistency
  • Grammar: “conditionally on” → “conditional on”; “which takes on” → “that takes on”; “cannot be simply included in regression” → “cannot simply be included in a regression”; “order between” → “order of”
  • Awkward phrasing: rewrote fragment definitions for interval and categorical variables as full sentences
  • Notation: added \mid \mathbf{X} to \E{U_i} for consistency with other lectures
  • Precision: “0.56% less” → “0.56 percentage points less”; “We can conclude” → “We cannot reject the hypothesis” (non-rejection ≠ acceptance)
  • Added “wage” to “$\delta_0$ measures the wage difference”; added “the” before “return to education”
  • RevealJS: indented 5 aligned blocks under parent bullets for proper incremental reveal (lines 136, 143, 150, 451, 475)
  • New slide: “Comparing consecutive groups” with successive-difference dummy definitions (D₂–D₅)
  • E-variable alignment: added & before second-column variables for proper alignment
  • Added lecture 14 to course page

Verification:

  • All 3 output formats render successfully, 0 KaTeX errors
  • 18 section tags (1 title + 17 content slides)
  • RevealJS reveal order verified: all indented blocks properly nested inside <li class="fragment">
  • No “Chow” or “structural break” content remains
  • Pushed to GitHub

2026-03-12

File changes:

  • Created 326_12_mreg_testing.qmd — new lecture converted from LaTeX 326_13_mreg_testing.tex

Conversion details (LaTeX lecture 13 → QMD lecture 12):

  • Title: “Lecture 12: Hypothesis testing in multiple regression” (dropped “Part 1”)
  • 15 slides covering: classical normal linear model assumptions, single coefficient tests (two-sided only), linear combination tests, CRS test example with manual calculation, reparameterization approach, and linearHypothesis() in R
  • All Stata code replaced with R equivalents: lm(), summary(), vcov(), qt(), car::linearHypothesis()
  • Simulated data generated with set.seed(123) for reproducibility
  • New slide added: “Testing with linearHypothesis() in R” showing car::linearHypothesis() for both CRS and equal-effects tests
  • Cross-references updated: “Lecture 12” → “Lecture 11”, “Lecture 11” → “Lecture 10”
  • Excluded: entire one-sided alternatives slide (LaTeX lines 367–413) and one-sided bullet (lines 591–593)
  • Spelling fixed: “multicolinearity” → “multicollinearity”
  • Grammar fixed: “Let … are some constants” → “Let … be some constants”
  • Macros used throughout: \E, \Var, \Cov, \Vhat, \se
  • Conditioning on \mathbf{X} applied per project convention

Proofreading (proofread-326 agent):

  • Grammar: “satisfies that conditional on” → fronted conditional clause
  • Margin overflow: variance formula split into align*; inline estimated variance moved to display math
  • RevealJS reveal order: 16 code blocks and 2 display math blocks indented under parent bullets

Verification:

  • All 3 output formats render successfully, 0 KaTeX errors
  • 16 section tags (1 title + 15 content slides)
  • No one-sided test material remains

2026-03-05

File changes:

  • Updated 326_10_r2.qmd — R example, reveal order, proofreading
  • Updated 326_11_mreg_properties.qmd — reveal order, proofreading

R example (326_10_r2.qmd):

  • Replaced fabricated numeric example with real data: lm(price ~ sqrft + bdrms + lotsize, data = hprice1) from wooldridge package (n=88, k=3, R²=0.6724, adj R²=0.6607, s=59.83)
  • Shows R code (library(wooldridge), lm(), summary()) and relevant summary() output
  • Second slide recovers SSR, SST, SSE from s and R²

RevealJS reveal-order fixes (verified by 3 agents: opus, codex, gemini):

  • Lecture 11, “Proof of unbiasedness” slide (line 123): converted 3 standalone blocks to bulleted steps for incremental reveal
  • Lecture 11, “Derivation of conditional variance” slide (line 190): indented aligned equation under its introducing bullet

Proofreading fixes (3-agent consensus: opus, codex, gemini):

  • Lecture 11: replaced 7 instances of “regress against” with “regress on”
  • Lecture 10, line 159: added articles before $R^2$ (“the $R^2$ from…”)
  • Lecture 11, line 271: added serial comma, reordered to “$k-1$ additional regressors”
  • Lecture 11, line 345: removed spurious comma before restrictive “if”

Deployment:

  • All 3 output formats render successfully, 0 KaTeX errors
  • Pushed to GitHub, deployment verified

2026-03-04

File changes:

  • Created 326_10_r2.qmd — Lecture 10: R-squared (converted from LaTeX 326_11_r2.tex)
  • Created 326_11_mreg_properties.qmd — Lecture 11: Properties of OLS in multiple regression (converted from LaTeX 326_12_mreg_properties.tex)
  • Updated /_teaching/2026-01-Econ-326.md — added lectures 10 and 11

New content (326_10_r2.qmd, ~300 lines):

  • 15 slides: Fitted values, Sum-of-Squares (SST/SSE/SSR), Proof of SST=SSE+SSR (2 slides), R², R² non-decreasing property, Proof (2 slides), Adjusted R², Estimation of σ², Unbiasedness of s², Stata example (4 slides)
  • Stata output recreated as code block with n=64, k=3, R²=0.5923, adj R²=0.5719

New content (326_11_mreg_properties.qmd, ~370 lines):

  • 16 slides: Multiple regression and OLS (2 slides), OLS estimators are linear, Unbiasedness, Proof of unbiasedness (2 slides), Conditional variance, Derivation of conditional variance, Conditional covariance (2 slides), Normality, Inclusion of irrelevant regressors (2 slides), Proof of variance inequality, Variance and number of regressors, Estimation of variances and covariances
  • Defined \mathbf{X} = \{(X_{1,i}, X_{2,i}, \ldots, X_{k,i}): i = 1, \ldots, n\} for multiple regression
  • Cross-reference to “Lecture 9” (partitioned regression) updated from LaTeX “Lecture 10”

Key results:

  • All conditioning uses \E{\cdot \mid \mathbf{X}}, \Var{\cdot \mid \mathbf{X}}, \Cov{\cdot \mid \mathbf{X}} macros throughout
  • Fixed LaTeX typos: “In n $Y_i$” → “In $Y_i$” (line 1371 of source), summation index in $w_{j,i}$ denominator corrected to use $l$ instead of $i$
  • Proofreading: grammar fixes (“i.e.” → “i.e.,”, removed filler “that”), long equations broken for RevealJS margin overflow, slide titles shortened
  • Reverted proofreader’s \begin{align*} conversion back to $$\begin{aligned}$$ for consistency with all other lectures
  • Both lectures: 0 KaTeX errors, all 3 output formats render successfully
  • Proofreading verified all mathematical derivations correct

Cross-references:

  • LaTeX 11 → QMD 10 (R²), LaTeX 12 → QMD 11 (properties)
  • Course page updated with lectures 10–11

2026-02-26

File changes:

  • Created /Users/vmarmer/GitHub/vadimmarmer.github.io/files/Econ_326/326_09_mreg.qmd — Lecture 9: Multiple regression (converted from LaTeX 326_10_mreg.tex)

New content (326_09_mreg.qmd):

  • 17 sections covering: motivation for multiple regression, omitted variable bias (2 slides), multiple linear regression model, interpretation of coefficients, changing multiple regressors simultaneously, modelling nonlinear effects, OLS estimation, normal equations (2 slides), partitioned regression, proof of partitioned regression result (5 slides), “partialling out”
  • YAML frontmatter for 3-format output (HTML, PDF, RevealJS)
  • Hidden macro div with \E, \Var, \Cov, \Vhat, \se

Key results:

  • Fixed known typo from LaTeX source line 1296: $X_{4}$$X_{k}$ in step 3 of the partitioned regression proof
  • Math review verified all derivations correct (omitted variable bias, OLS FOCs, normal equations, partitioned regression proof steps 1-4)
  • Flagged: line 143 equation $\Delta Y = \beta_0 + \beta_1 \Delta X_1 + \beta_2 X_2 + \ldots$ inherited from original LaTeX source is mathematically incorrect as a “change” equation (should be $\Delta Y = \beta_1 \Delta X_1$)
  • 18 prose edits applied (unanimous/majority agreement from 3-agent polishing): “regress against” → “regress on” throughout, missing articles, “and etc.” → “etc.”, “squared errors function” → “sum of squared errors”, commas before nonrestrictive “which”, and other grammar fixes
  • Adopted \E{\cdot \mid \mathbf{X}} notation throughout: converted bare E\left(...\right) to \E{...} macro, changed assumption to \E{U_i \mid \mathbf{X}} = 0, added \mathbf{X} definition in OVB slide
  • Removed $ wrapping from \gdef macros in hidden div (caused visible $ in PDF output)
  • Fixed reveal order on 5 slides (Partitioned regression, Proof slides, “Partialling out”): indented standalone text/equations under bullet points for proper incremental reveal
  • Added lecture 9 entry to course page (_teaching/2026-01-Econ-326.md)
  • All 3 output formats render successfully, 0 KaTeX errors

Cross-references:

  • LaTeX source: /Users/vmarmer/Documents/teaching/Econ 326/326_10_mreg.tex
  • YAML template: 326_08_htesting.qmd
  • Numbering: LaTeX lecture 10 → QMD lecture 09 (shift by 1 for N ≥ 10)

2026-02-15

File changes:

  • Created /Users/vmarmer/Documents/teaching/Econ 326/326_ps_05.tex — Assignment 5 (2 pages)
  • Updated /Users/vmarmer/Documents/teaching/Econ 326/TODO.md — all items marked completed

New content (326_ps_05.tex):

  • Q1: Intercept-only model Y_i = beta_0 + U_i — interpret beta_0, derive E[sum hat_U_i^2] = (n-1)sigma^2, propose unbiased estimator of sigma^2
  • Q2: Derive Var(beta_1_WLSX) under classical assumptions for simple regression with arbitrary positive weights w_i(X_i); includes hint showing WLS estimator formula with weighted means
  • Q3: R output (rent ~ income, n=26) with missing entries A-D (SE, CI bounds); interpret 95% CI; construct 90% CI and compare widths
  • Q4: Propose one-sided CI (-inf, U] for beta_1 using t critical values; prove coverage = 1-alpha under normality

Config changes:

  • Added “Session notes” and “TODO list” sections to project CLAUDE.md
  • Added user preferences (session notes, TODO tracking) to project MEMORY.md

2026-03-17

Proofread: 326_12_mreg_testing.qmd (Lecture 12: Hypothesis testing in multiple regression)

Changes made:

  • Pass 5 (conditioning): Added “conditional on X” to three distributional statements on lines 102, 131, and 154 that were missing explicit conditioning
  • Pass 6 (display math): Converted four $$egin{aligned}...nd{aligned}$$ blocks to egin{align*}...nd{align*} (lines 118, 133, 187, 296)
  • Pass 6 (line breaking): Split long single-line estimated variance equation (line 173) into two-line align* block to prevent RevealJS overflow

No issues found in:

  • Pass 1 (spelling): No errors
  • Pass 2 (grammar): No errors
  • Pass 3 (notation): Macros (\E, \Var, \Cov, \Vhat, \se) used consistently; \widehat{\mathrm{Cov}} used for estimated covariance (no macro exists; consistent with Lecture 11)
  • Pass 4 (math correctness): All formulas, degrees of freedom, and derivations verified correct
  • Pass 7 (slide titles): All 15 ## headings within ~50-character limit
  • Pass 8 (reveal order): All display math and code chunks properly indented under parent bullets; no loose text between bullet items

Compilation: All three formats (HTML, PDF, RevealJS) render cleanly with 0 KaTeX errors.

2026-03-19

Lecture 16: Asymptotics — merged 3 LaTeX lectures into 1 QMD

Files created:

  • 326_16_asy.qmd (~890 lines) — merged from LaTeX sources 326_16_asy.tex, 326_17_asy_norm.tex, 326_18_asy_var.tex
  • Output: output/326_16_asy.html, output/326_16_asy.pdf, output/326_16_asy_slides.html

Files modified:

  • CLAUDE.md — updated lectures table: LaTeX 16+17+18 merged into QMD 16, total lectures 19→17, “Lectures 01–16 are converted”

Structure:

  • Part I: Consistency (20 slides) — convergence in probability, LLN, Markov/Chebyshev, OLS consistency, omitted variable bias
  • Part II: Asymptotic Normality (13 slides) — convergence in distribution, CLT, OLS asymptotic normality + proof
  • Part III: Asymptotic Variance (14 slides) — variance estimation, t-test, heteroskedasticity, HC estimator

Key decisions:

  • KaTeX (no \fragment machinery)
  • Stata regress ... robust example → R with lmtest::coeftest() + sandwich::vcovHC() using wage1 dataset (eval: false)
  • Three # level-1 headings for major TOC sections

Verification:

  • quarto render clean (all 3 formats)
  • 0 KaTeX errors in HTML and slides
  • 54 section tags in slides HTML
  • proofread-326 agent: ~70+ fixes (spelling, grammar, \E{} macro consistency, overflow, slide titles)
  • revealjs-check agent: 6 reveal-order fixes; 13 long-math-line flags remain (advisory)

2026-03-26

Lecture 16 (326_16_did.qmd)

  • Renamed “DID setup” → “DID basic setup” (~line 55)
  • Added red time subscripts to “Interpreting the coefficients” bullet (~lines 107-108)
  • Added “Four potential outcomes” bullet grouped by d (~line 168)
  • Added red time subscripts to “Parallel trends” equation (~line 225)
  • Fixed DID diagram: removed alpha arrow, moved delta arrow to t=1 under beta, added thin reference line, teal beta arrow, widened xlim for labels

Lecture 17 (326_17_asy.qmd)

  • Moved “Part I: Consistency” heading to just before convergence in probability (~line 76)
  • Added “Proof of Markov’s inequality” slide with indicator trick, E[1(A)]=P(A) explanation, and line-by-line incremental reveal (~lines 133-156)
  • Added line-by-line incremental reveal to “Proof of the LLN” slide (~lines 158-180)
  • Switched RevealJS and HTML from KaTeX to MathJax (required for \fragment macro)
  • Added \fragment macro (mjxfrag marker class), include-after-body for JS normalizer, PDF header fallback
  • Key lesson: \fragment{} must NOT contain & alignment markers; & must be outside \fragment

2026-03-27

Lecture 20: Two-Stage Least Squares (new)

  • Created: 326_20_2SLS.qmd — converted from LaTeX 326_21_2SLS.tex
  • Content (12 slides):
    • Multiple linear IV model (example + general notation)
    • Identification problem (counting unknowns vs equations)
    • Instrumental variables (IVs, moment conditions, necessary condition l ≥ m)
    • First-stage equations (structural + reduced-form system)
    • Order condition for identification (exactly/over/underidentified)
    • 2SLS procedure: first stage (OLS on first-stage equations → fitted values)
    • 2SLS procedure: second stage (OLS with fitted values; SE correction)
    • Example: returns to education (MROZ dataset, Stata output, 2SLS vs OLS comparison)
  • Color scheme: blue = exogenous (X’s, Z’s, equation counts), red = endogenous (Y’s, coefficient counts, identification condition)
  • Proofreading: 6 changes — 5 language tightening, 1 overflow fix (second-stage equation split into align*)
  • RevealJS check: clean, no issues
  • Rendering: all three formats OK, 0 KaTeX errors
  • Output: output/326_20_2SLS.html, output/326_20_2SLS.pdf, output/326_20_2SLS_slides.html