class: center, middle, inverse, title-slide .title[ # Lecture 10 ] .subtitle[ ## OLS // Regression ] .author[ ### Ivan Rudik ] .date[ ### AEM 4510 ] --- exclude: true ``` r if (!require("pacman")) install.packages("pacman") ``` ``` ## Loading required package: pacman ``` ``` r pacman::p_load( tidyverse, xaringanExtra, rlang, patchwork, nycflights13, broom, viridis, janitor ) options(htmltools.dir.version = FALSE) knitr::opts_hooks$set(fig.callout = function(options) { if (options$fig.callout) { options$echo = FALSE } knitr::opts_chunk$set( cache = TRUE, echo = TRUE, fig.align = "center" ) options }) red_pink = "#e64173" # A blank theme for ggplot theme_empty = theme_minimal() + theme( legend.position = "none", title = element_text(size = 24), axis.text.x = element_text(size = 24), axis.text.y = element_text(size = 24, color = "#ffffff"), axis.title.x = element_text(size = 24), axis.title.y = element_text(size = 24), panel.grid.minor.x = element_blank(), panel.grid.major.y = element_blank(), panel.grid.minor.y = element_blank(), panel.grid.major.x = element_blank(), panel.background = element_rect(fill = "#ffffff", colour = NA), plot.background = element_rect(fill = "#ffffff", colour = NA), axis.line = element_line(colour = "black"), axis.ticks = element_line(), ) theme_blank = theme_minimal() + theme( legend.position = "none", title = element_text(size = 24), axis.text.x = element_blank(), axis.text.y = element_blank(), axis.title.x = element_blank(), axis.title.y = element_blank(), panel.grid.minor.x = element_blank(), panel.grid.major.y = element_blank(), panel.grid.minor.y = element_blank(), panel.grid.major.x = element_blank(), panel.background = element_rect(fill = "#ffffff", colour = NA), plot.background = element_rect(fill = "#ffffff", colour = NA), axis.line = element_blank(), axis.ticks = element_blank(), ) theme_regular = theme_minimal() + theme( legend.position = "none", title = element_text(size = 14), axis.text.x = element_text(size = 24), axis.text.y = element_text(size = 24), axis.title.x = element_text(size = 24), axis.title.y = element_text(size = 24), panel.grid.minor.x = element_blank(), panel.grid.minor.y = element_blank(), panel.grid.major.x = element_blank(), axis.ticks = element_line(), axis.line = element_line(), panel.background = element_rect(fill = "#ffffff", colour = NA), plot.background = element_rect(fill = "#ffffff", colour = NA) ) nascar_df = read_csv("data/10-florida-nascar.csv") |> as_tibble() ``` ``` ## Rows: 68858 Columns: 12 ``` ``` ## ── Column specification ──────────────────────────────────────────────────────── ## Delimiter: "," ## chr (1): school_name ## dbl (11): school_id, grade, year, zscore, nascar_lead, nascar_lead_weighted,... ## ## ℹ Use `spec()` to retrieve the full column specification for this data. ## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message. ``` ``` ## Warning in xaringanExtra::style_panelset(panel_tab_color_active = "red"): 'xaringanExtra::style_panelset' is deprecated. ## Use 'style_panelset_tabs' instead. ## See help("Deprecated") ``` ``` ## Warning in style_panelset_tabs(...): The argument names of `style_panelset()` ## changed in xaringanExtra 0.1.0. Please refer to the documentation to update to ## the latest names. ``` ``` ## NULL ``` --- # Roadmap - Intro to regression and ordinary least squares --- class: inverse, center, middle name: tidyverse # Regression and ordinary least squares <html><div style='float:left'></div><hr color='#EB811B' size=1px width=796px></html> --- # Why? Let's start with a few .hi[basic, general questions] -- 1. What is the goal of econometrics? 2. Why do economists (or other people) study or use econometrics? -- .hi[One simple answer:] Learn about the world using data --- # Why? Example GPA is an output from endowments (ability), and hours studied (inputs), and pollution exposure (externality) -- One might hypothesize a model: `\(\text{GPA}=f(I, P, \text{SAT}, H)\)` where `\(H\)` is hours studied, `\(P\)` is pollution exposure, `\(\text{SAT}\)` is SAT score and `\(\text{I}\)` is family income -- We expect that GPA will rise with some variables, and decrease with others -- But who needs to _expect_? -- We can test these hypotheses .hi[using a regression model] --- # How? We can write down a linear regression model of the relationship between GPA and (H, P, SAT, PCT): $$ \text{GPA}_i = \beta_0 + \beta_1 I_i + \beta_2 P_i + \beta_3 \text{SAT}_i + \beta_4 H_i + \varepsilon_i $$ -- The left hand side of the equals sign is our .hi-blue[dependent variable] GPA -- The right hand side of the equals sign contains all of our .hi-red[independent variables] (I, P, SAT, H), and an error term `\(\varepsilon_i\)` (described later) -- The subscript `\(i\)` means that the variable contains the value for some person `\(i\)` in our dataset where `\(i = 1,\dots,N\)` --- # How? $$ \text{GPA}_i = \beta_0 + \beta_1 I_i + \beta_2 P_i + \beta_3 \text{SAT}_i + \beta_4 H_i + \varepsilon_i $$ We are interested in how pollution P affects GPA -- This is given by `\(\beta_2\)` -- Notice that `\(\beta_2 = \frac{\partial\text{GPA}_i}{\partial\text{P}_i}\)` -- `\(\beta_2\)` tells us how GPA changes, given a 1 unit increase in pollution! -- Our goal will be to estimate `\(\beta_2\)`, we denote estimates with hats: `\(\hat{\beta}_2\)` --- # How? How do we estimate `\(\beta_2\)`? -- First, suppose we have a set of estimates for all of our `\(\beta\)`s, then we can *estimate* the GPA `\((\widehat{GPA}_i)\)` for any given person based on just (I, P, SAT, H): `$$\widehat{GPA}_i = \hat{\beta}_0 + \hat{\beta}_1 I_i + \hat{\beta}_2 P_i + \hat{\beta}_3 \text{SAT}_i + \hat{\beta}_4 H_i$$` --- # How? We estimate the `\(\beta\)`s with .hi[linear regression], specifically ordinary least squares .hi[Ordinary least squares:] choose all the `\(\beta\)`s so that the sum of squared errors between the *real* GPAs and model-estimated GPAs are minimized: `$$SSE = \sum_{i=1}^N (GPA_i - \widehat{GPA}_i)^2$$` -- Choosing the `\(\beta\)`s in this fashion gives us the best-fit line through the data --- # How? --- # Simple example Suppose we were only looking at GPA and pollution (lead/Pb): $$\text{GPA}_i = \beta_0 + \beta_1 P_i + \varepsilon_i $$ <img src="10-slides-econometrics_files/figure-html/ols vs lines 1-1.svg" alt="" style="display: block; margin: auto;" /> --- count: false # Simple example For any line `\(\left(\hat{GPA}_i = \hat{\beta}_0 + \hat{\beta}_1 P_i\right)\)` <img src="10-slides-econometrics_files/figure-html/vs lines 2-1.svg" alt="" style="display: block; margin: auto;" /> --- count: false # Simple example For any line `\(\left(\hat{GPA}_i = \hat{\beta}_0 + \hat{\beta}_1 P_i\right)\)`, we calculate errors: `\(e_i = GPA_i - \hat{GPA}_i\)` <img src="10-slides-econometrics_files/figure-html/ols vs lines 3-1.svg" alt="" style="display: block; margin: auto;" /> --- count: false # Simple example For any line `\(\left(\hat{GPA}_i = \hat{\beta}_0 + \hat{\beta}_1 P_i\right)\)`, we calculate errors: `\(e_i = GPA_i - \hat{GPA}_i\)` <img src="10-slides-econometrics_files/figure-html/ols vs lines 4-1.svg" alt="" style="display: block; margin: auto;" /> --- count: false # Simple example For any line `\(\left(\hat{GPA}_i = \hat{\beta}_0 + \hat{\beta}_1 P_i\right)\)`, we calculate errors: `\(e_i = GPA_i - \hat{GPA}_i\)` <img src="10-slides-econometrics_files/figure-html/ols vs lines 5-1.svg" alt="" style="display: block; margin: auto;" /> --- count: false # Simple example SSE squares the errors `\(\left(\sum e_i^2\right)\)`: bigger errors get bigger penalties <img src="10-slides-econometrics_files/figure-html/ols vs lines 6-1.svg" alt="" style="display: block; margin: auto;" /> --- count: false # Simple example The OLS estimate is the combination of `\(\hat{\beta}_0\)` and `\(\hat{\beta}_1\)` that minimize SSE <img src="10-slides-econometrics_files/figure-html/ols vs lines 7-1.svg" alt="" style="display: block; margin: auto;" /> --- # OLS error term So OLS is just the best-fit line through your data -- Remember: for any given `\(i\)`, we won't have that `\(GPA_i = \widehat{GPA}_i\)`, there's always some error -- Why? -- Our model isn't perfect, the people in our dataset (i.e. our sample) may not perfectly match up to the entire population of people --- # OLS error term There's .hi[a lot] of other stuff that determines GPAs! -- We jam all that stuff into error term `\(\varepsilon_i\)`: $$ \text{GPA}_i = \beta_0 + \beta_1 I_i + \beta_2 P_i + \beta_3 \text{SAT}_i + \beta_4 H_i + \varepsilon_i $$ -- So `\(\varepsilon_i\)` contains all the determinants of GPA that we aren't explicitly addressing in our model like: - Home environment - Time studying -- It is just a "catch-all", we don't actually know or see `\(\varepsilon_i\)` --- # OLS properties OLS has one .hi[very] nice property relevant for this class: -- <center> .hi-blue[Unbiasedness:] `\(E[\hat{\beta}] = \beta\)` </center> --- # OLS properties .hi-blue[Unbiasedness:] `\(E[\hat{\beta}] = \beta\)` On average, our estimate `\(\hat{\beta}\)` exactly equals the .hi[true] `\(\beta\)` -- The key is .hi-red[on average:] we are estimating our model using only some sample of the data -- The estimated `\(\beta\)` won't exactly be right for the entire population, but on average, we expect it to match -- Let's see in an example where we only have a subsample of the full population of data --- # OLS properties .pull-left[ <img src="10-slides-econometrics_files/figure-html/pop1-1.svg" alt="" style="display: block; margin: auto;" /> .center[**Population**] ] -- .pull-right[ <img src="10-slides-econometrics_files/figure-html/scatter1-1.svg" alt="" style="display: block; margin: auto;" /> .center[**Population relationship**] $$ \text{GPA}_i = 2.53 + -0.43 P_i + u_i $$ $$ \text{GPA}_i = \beta_0 + \beta_1 P_i + u_i $$ ] --- .pull-left[ <img src="10-slides-econometrics_files/figure-html/sample1-1.svg" alt="" style="display: block; margin: auto;" /> .center[**Sample 1:** 10 random individuals] ] -- .pull-right[ <img src="10-slides-econometrics_files/figure-html/sample1 scatter-1.svg" alt="" style="display: block; margin: auto;" /> .center[ **Population relationship** <br> `\(\text{GPA}_i = 2.53 + -0.43 P_i + u_i\)` **Sample relationship** <br> `\(\widehat{\text{GPA}}_i = 0.72 + -0.19 P_i\)` ] ] --- count: false .pull-left[ <img src="10-slides-econometrics_files/figure-html/sample2-1.svg" alt="" style="display: block; margin: auto;" /> .center[**Sample 2:** 10 random individuals] ] .pull-right[ <img src="10-slides-econometrics_files/figure-html/sample2 scatter-1.svg" alt="" style="display: block; margin: auto;" /> .center[ **Population relationship** <br> `\(\text{GPA}_i = 2.53 + -0.43 P_i + u_i\)` **Sample relationship** <br> `\(\widehat{\text{GPA}}_i = 2.82 + -0.47 P_i\)` ] ] --- count: false .pull-left[ <img src="10-slides-econometrics_files/figure-html/sample3-1.svg" alt="" style="display: block; margin: auto;" /> .center[**Sample 3:** 10 random individuals] ] .pull-right[ <img src="10-slides-econometrics_files/figure-html/sample3 scatter-1.svg" alt="" style="display: block; margin: auto;" /> .center[ **Population relationship** <br> `\(\text{GPA}_i = 2.53 + -0.43 P_i + u_i\)` **Sample relationship** <br> `\(\widehat{\text{GPA}}_i = 2.32 + -0.44 P_i\)` ] ] --- layout: false class: clear, middle Let's repeat this **1,000 times**. (This exercise is called a (Monte Carlo) simulation.) --- # Population *vs.* sample <!-- --> --- # Population *vs.* sample **Question:** Why do we care about *population vs. sample*? --- .pull-left[ <!-- --> ] .pull-right[ On .hi-blue[average], our regression lines match the population line very nicely However, .hi[individual lines] (samples) can really miss the mark ] --- # Population *vs.* sample **Answer:** Uncertainty/randomness matters! -- `\(\hat{\beta}\)` itself is will depend on the sample of data we have -- When we take a sample and run a regression, we don't know if it's a 'good' sample ( `\(\hat{\beta}\)` is close to `\(\beta\)`) or a 'bad sample' (our sample differs greatly from the population) --- # Unbiasedness For OLS to be unbiased and give us, on average, the causal effect of some X on some Y we need a few assumptions to hold -- Whether or not these assumptions are true is why you often hear *correlation is not causation* -- If we want some `\(\hat{\beta}_1\)` on a variable `\(x\)` to be unbiased we `\(x\)` to be .hi[uncorrelated] with the error term: `$$E[x \varepsilon] = 0 \quad \leftrightarrow \quad \text{correlation}(x,\varepsilon) = 0$$` --- # Unbiasedness The variable you are interested in .hi[cannot] be correlated with the error term -- What does this mean in words? -- The error term contains all variables that determine `\(y\)`, but we *omitted* from our model -- We are assuming that our variable of interest, x, is not correlated with any of these omitted variable -- If x is correlated with any of them, then we will have something called .hi[omitted variable bias] --- # Omitted variable bias Here's an intuitive example -- Suppose we wanted to understand the effect of lead exposure `\(P\)` on GPAs -- lead harm's children's brain development, especially before age 6 -- We should expect early-life lead exposure to reduce future GPAs --- # Omitted variable bias Our model might look like: `$$\text{GPA}_i = \beta_0 + \beta_1 \text{P}_i + \varepsilon_i$$` -- We want to know `\(\beta_1\)` -- What would happen if we took a sample of *real world data* and used OLS to estimate `\(\hat{\beta}_1\)`? --- # Omitted variable bias We would have omitted variable bias -- Why? What are some examples? -- .hi[Who] is more likely to be exposed to lead? -- Poorer families likely have more lead exposure, why? -- Richer families can move away, pay to replace lead paint, lead pipes, etc -- This means lead exposure is correlated with lower income --- # Omitted variable bias Why does this correlation cause us problems? -- Family income *also* matters for GPA, it is in `\(\varepsilon_i\)`, so our assumption that `\(\text{correlation}(x,\varepsilon) = 0\)` is violated -- Children from richer families tend to have higher GPAs -- Why? -- Access to tutoring, better schools, parental pressure, etc, etc --- # Omitted variable bias If we just look at the effect of lead exposure on GPAs without addressing its correlation with income, lead exposure will look worse than it actually is -- This is because our data on lead exposure is also proxying for income (since `\(\text{correlation}(x,\varepsilon) = 0\)` ) -- Poorer households are exposed to more lead **and** have fewer tutoring resources -- `\(\hat{\beta}_1\)` will pick up the effect of both! -- Our estimate `\(\hat{\beta}_1\)` is .hi[biased] and overstates the negative effects of lead --- # Omitted variable bias How do we fix this bias? -- Make income not omitted: control for it in our model -- If we have data on family income `\(I\)` we can instead write our model as: `$$\text{GPA}_i = \beta_0 + \beta_1 \text{P}_i + \beta_2 \text{I}_i + \varepsilon_i$$` `\(I\)` is no longer omitted -- Independent variables in our model that we include to address bias are called .hi[controls] --- class: inverse, center, middle name: r # Hands-on pollution education example <html><div style='float:left'></div><hr color='#EB811B' size=1px width=796px></html> --- # Real pollution education example <center> <img src="files/10-alex-nascar.png" alt="" width="80%" /> </center> --- # Real pollution education example In .hi[3 hours], one NASCAR race emits more lead than a majority of industrial facilities do in an .hi[entire year] .center[ <!-- --> ] --- # We will look at Florida <center> <img src="files/10-florida-map.png" alt="" width="80%" /> </center> --- # All the data are public, you can look at scores yourself! <center> <img src="files/10-fcat-site.png" alt="" width="80%" /> </center> --- # Let's look at the data <table class="table" style="font-size: 18px; width: auto !important; margin-left: auto; margin-right: auto;"> <thead> <tr> <th style="text-align:right;"> School ID </th> <th style="text-align:left;"> School </th> <th style="text-align:right;"> Grade </th> <th style="text-align:right;"> Year </th> <th style="text-align:right;"> Test avg </th> <th style="text-align:right;"> NASCAR lead </th> <th style="text-align:right;"> Industrial lead </th> <th style="text-align:right;"> Median income </th> <th style="text-align:right;"> Students </th> </tr> </thead> <tbody> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2003 </td> <td style="text-align:right;"> -0.186 </td> <td style="text-align:right;"> 72.25 </td> <td style="text-align:right;"> 822328.0 </td> <td style="text-align:right;"> 49267 </td> <td style="text-align:right;"> 112 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 2003 </td> <td style="text-align:right;"> 0.101 </td> <td style="text-align:right;"> 80.37 </td> <td style="text-align:right;"> 822639.0 </td> <td style="text-align:right;"> 49267 </td> <td style="text-align:right;"> 117 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 2003 </td> <td style="text-align:right;"> -0.206 </td> <td style="text-align:right;"> 88.02 </td> <td style="text-align:right;"> 822909.0 </td> <td style="text-align:right;"> 49267 </td> <td style="text-align:right;"> 120 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2004 </td> <td style="text-align:right;"> -0.686 </td> <td style="text-align:right;"> 73.97 </td> <td style="text-align:right;"> 967077.5 </td> <td style="text-align:right;"> 50842 </td> <td style="text-align:right;"> 131 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 2004 </td> <td style="text-align:right;"> -0.633 </td> <td style="text-align:right;"> 82.39 </td> <td style="text-align:right;"> 967352.5 </td> <td style="text-align:right;"> 50842 </td> <td style="text-align:right;"> 105 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 2004 </td> <td style="text-align:right;"> 0.352 </td> <td style="text-align:right;"> 90.52 </td> <td style="text-align:right;"> 967663.5 </td> <td style="text-align:right;"> 50842 </td> <td style="text-align:right;"> 109 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2005 </td> <td style="text-align:right;"> -1.138 </td> <td style="text-align:right;"> 76.98 </td> <td style="text-align:right;"> 1061570.2 </td> <td style="text-align:right;"> 52390 </td> <td style="text-align:right;"> 110 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 4 </td> <td style="text-align:right;"> 2005 </td> <td style="text-align:right;"> -0.649 </td> <td style="text-align:right;"> 84.74 </td> <td style="text-align:right;"> 1062071.2 </td> <td style="text-align:right;"> 52390 </td> <td style="text-align:right;"> 137 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 5 </td> <td style="text-align:right;"> 2005 </td> <td style="text-align:right;"> -0.336 </td> <td style="text-align:right;"> 92.02 </td> <td style="text-align:right;"> 1062346.2 </td> <td style="text-align:right;"> 52390 </td> <td style="text-align:right;"> 97 </td> </tr> <tr> <td style="text-align:right;"> 56 </td> <td style="text-align:left;"> HAMILTON ELEM </td> <td style="text-align:right;"> 3 </td> <td style="text-align:right;"> 2006 </td> <td style="text-align:right;"> -0.333 </td> <td style="text-align:right;"> 79.91 </td> <td style="text-align:right;"> 1164071.5 </td> <td style="text-align:right;"> 56655 </td> <td style="text-align:right;"> 133 </td> </tr> </tbody> </table> --- # The variables - .hi[test avg]: the school's score for the average student in terms of standard deviations above or below the state-wide average - .hi[nascar lead]: lifetime exposure to lead emissions from NASCAR tracks within 50 miles - .hi[industrial lead]: lead emissions from industrial sources (e.g. factories) within 50 miles - .hi[median income]: the school district's median incoe - .hi[num students]: the number of students at the school - .hi[school id, school name, grade, and year]: self-explanatory --- # What does the distribution of scores look like? <img src="10-slides-econometrics_files/figure-html/unnamed-chunk-7-1.png" alt="" style="display: block; margin: auto;" /> --- # What about exposure to NASCAR lead .pull-left[ <img src="10-slides-econometrics_files/figure-html/unnamed-chunk-8-1.png" alt="" style="display: block; margin: auto;" /> ] .pull-right[ Most schools have zero exposure Some have a lot Units are 10s of kilograms ] --- # What is the association between lead and scores? .pull-left[  ] .pull-right[ Let's look at the pure correlation between test scores and lead It appears there's a .hi-red[negative] association: lead is bad for test scores ] --- # What is the association between lead and scores? We can get a better sense by running a regression: `$$test\ avg_{sgy} = \beta_0 + \beta_1 nascar\_lead\_weighted_{sgy}$$` `\((s\)` is school, `\(g\)` is grade, `\(y\)` is year) --- # What is the association between lead and scores? <table class="table" style="font-size: 18px; width: auto !important; margin-left: auto; margin-right: auto;"> <caption style="font-size: initial !important;">Estimation results</caption> <thead> <tr> <th style="text-align:left;"> Parameter </th> <th style="text-align:right;"> Estimate </th> <th style="text-align:right;"> Std. error </th> <th style="text-align:right;"> t value </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> beta_0 (Intercept) </td> <td style="text-align:right;"> 0.0024 </td> <td style="text-align:right;"> 0.0042 </td> <td style="text-align:right;"> 0.58 </td> </tr> <tr> <td style="text-align:left;"> beta_1 NASCAR lead </td> <td style="text-align:right;"> -0.0040 </td> <td style="text-align:right;"> 0.0033 </td> <td style="text-align:right;"> -1.23 </td> </tr> </tbody> </table> What does this mean? An additional 10 kg of lead exposure is associated with a school having an average test score 0.004 standard deviations lower --- # Do we believe this number? What's a potential issue with just looking at the raw association? -- Schools near NASCAR tracks are probably a lot different than schools further away -- We want to control for things that are potentially correlated with both test scores and being close to NASCAR -- Two broad important things: lead emissions from other sources, socioeconomic status --- # Do we believe this number? `$$test\ avg_{sgy} = \beta_0 + \beta_1 nascar\_lead\_weighted_{sgy} + \beta_2 other\_lead_{sgy} + \beta_3 income_{sgy}$$` <table class="table" style="font-size: 18px; width: auto !important; margin-left: auto; margin-right: auto;"> <caption style="font-size: initial !important;">Estimation results with controls</caption> <thead> <tr> <th style="text-align:left;"> Parameter </th> <th style="text-align:left;"> Estimate </th> <th style="text-align:left;"> Note </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> beta_0 (Intercept) </td> <td style="text-align:left;"> -0.846 </td> <td style="text-align:left;"> </td> </tr> <tr> <td style="text-align:left;"> beta_1 NASCAR lead </td> <td style="text-align:left;"> -0.0008 </td> <td style="text-align:left;"> (versus -0.004 above) </td> </tr> <tr> <td style="text-align:left;"> beta_2 Other lead </td> <td style="text-align:left;"> -0.00000006 </td> <td style="text-align:left;"> (other lead = bad!) </td> </tr> <tr> <td style="text-align:left;"> beta_3 Income </td> <td style="text-align:left;"> 0.00002 </td> <td style="text-align:left;"> (rich family = good!) </td> </tr> </tbody> </table> Controlling for other things matters: new estimate is 1/4 the size --- # Why did this matter? .pull-left[  ] .pull-right[ Mainly because places with NASCAR tracks tend to be poorer ]