class: center, middle, inverse, title-slide # Interpreting Results --- layout: true <div class="my-footer"> <span> Dr. Lucy D'Agostino McGowan </span> </div> --- class: center, middle ![](img/03/pep-tweet.png) --- ![](img/03/stats-lecture-poster.jpg) --- ## Interpreting Results There are 3 unknowns in a simple linear regression that we are **estimating**: * `\(\Large\hat{\beta}_0\)` * `\(\Large\hat{\beta}_1\)` * `\(\Large\hat{\sigma}_\epsilon\)` Let's talk about what they mean in _words_ --- ## Interpreting Results `\(\Large \hat{\textrm{Weight}} = \hat{\beta_0}+ \hat{\beta_1}\textrm{Wing Length} + \epsilon\)` ```r lm(Weight ~ WingLength, data = Sparrows) ``` ``` ## ## Call: ## lm(formula = Weight ~ WingLength, data = Sparrows) ## ## Coefficients: ## (Intercept) WingLength ## 1.3655 0.4674 ``` --- ## Interpreting Results `\(\Large \hat{\textrm{Weight}} = \hat{\beta_0}+ \hat{\beta_1}\textrm{Wing Length} + \epsilon\)` ```r lm(Weight ~ WingLength, data = Sparrows) ``` ``` ## ## Call: ## lm(formula = Weight ~ WingLength, data = Sparrows) ## ## Coefficients: ## (Intercept) WingLength ## 1.3655 0.4674 ``` .question[ How can we end up with just `\(\hat{\beta}_0\)` on one side of the equation? ] --- class: center, middle ## `\(\hat{\beta}_0\)` is the expected mean value of `\(y\)` when `\(x\)` is 0 --- ## Interpreting Results `\(\Large \hat{\textrm{Weight}} = \hat{\beta_0}+ \hat{\beta_1}\textrm{Wing Length} + \epsilon\)` ```r lm(Weight ~ WingLength, data = Sparrows) ``` ``` ## ## Call: ## lm(formula = Weight ~ WingLength, data = Sparrows) ## ## Coefficients: ## (Intercept) WingLength ## 1.3655 0.4674 ``` .question[ What does `\(\hat{\beta}_0\)` mean here? ] --- ## Interpreting Results `\(\Large \hat{\textrm{Weight}} = \hat{\beta_0}+ \hat{\beta_1}\textrm{Wing Length} + \epsilon\)` ```r lm(Weight ~ WingLength, data = Sparrows) ``` ``` ## ## Call: ## lm(formula = Weight ~ WingLength, data = Sparrows) ## ## Coefficients: ## (Intercept) WingLength ## 1.3655 0.4674 ``` .question[ How do we interpret `\(\hat{\beta}_1\)`? ] --- class: center, middle ## For every one unit change in `\(x\)` the expected mean value of `\(y\)` changes by `\(\hat{\beta}_1\)`. --- ## Interpreting Results `\(\Large \hat{\textrm{Weight}} = \hat{\beta_0}+ \hat{\beta_1}\textrm{Wing Length} + \epsilon\)` ```r lm(Weight ~ WingLength, data = Sparrows) ``` ``` ## ## Call: ## lm(formula = Weight ~ WingLength, data = Sparrows) ## ## Coefficients: ## (Intercept) WingLength ## 1.3655 0.4674 ``` .question[ What does `\(\hat{\beta}_1\)` mean here? ] --- ## Interpreting Results ```r Sparrows %>% mutate(y_hat = lm(Weight ~ WingLength, data = Sparrows) %>% predict(), residuals_2 = (Weight - y_hat)^2) %>% summarise(rse = sqrt(sum(residuals_2) / (n() - 2))) ``` ``` ## rse ## 1 1.399595 ``` .question[ What is the interpretation of the regression (residual) standard error? ] --- class: center, middle ## `\(\hat{\sigma}_\epsilon\)` is the "typical error" --- ## Interpreting Results ``` ## rse ## 1 1.399595 ``` ```r y_hat <- lm(Weight ~ WingLength, data = Sparrows) %>% predict() Sparrows %>% mutate(residual = Weight - y_hat) %>% select(Weight, residual) %>% slice(1:5) ``` ``` ## Weight residual ## 1 14.9 -0.02020496 ## 2 15.0 -0.85501292 ## 3 14.3 1.24941095 ## 4 17.0 2.07979504 ## 5 16.0 0.61239106 ``` ---