class: center, middle, inverse, title-slide # Midterm Review ## EC 320: Introduction to Econometrics ### Kyle Raze ### Fall 2019 --- class: inverse, middle # Prologue --- # Housekeeping Problem Set 4 - Due tonight by 23:59 on Canvas Midterm 2 on Wednesday - .hi[You still have lab this week!] - [Maps!](https://socviz.co/maps.html#maps) Extended office hours - Tomorrow 15:00 to 17:00 - Room TBA --- class: inverse, middle # Midterm II: The Weeds --- # Midterm Topics .green[Anything from the lectures, labs, or problem sets] .hi-green[is fair game!] 1. Simple Linear Regression: Estimation I & II 2. Classical Assumptions 3. Simple Linear Regression: Inference 4. Multiple Linear Regression: Estimation 5. Multiple Linear Regression: Inference 6. Regressions in .mono[R] --- # Midterm Topics ## 1. Simple Linear Regression: Estimation OLS mechanics - How does OLS pick parameter estimates? - What properties are a direct consequence of OLS? - Residuals *v.s.* errors Coefficient interpretation (literal) --- # Midterm Topics ## 1. Simple Linear Regression: Estimation (cont.) Goodness of fit - `\(R^2\)` interpretation (literal) - Understand `\(R^2\)` derivation - Use and misuse of `\(R^2\)` OLS by hand - Estimate coefficients and calculate `\(R^2\)`. - Don't have to calculate standard errors by hand. --- # Midterm Topics ## 2. Classical Assumptions Six assumptions 1. Linearity 2. Sample variation/no perfect collinearity 3. Random sampling 4. Exogeneity 5. Homoskedasticity 6. Normality What do they buy? When are they satisfied? When are they violated? --- # Midterm Topics ## 2. Classical Assumptions (cont.) **So what?** - Coefficient interpretation (substantive) - Hypothesis test validity. --- # Midterm Topics ## 3. Simple Linear Regression: Inference Making inferences about population parameters - Population *v.s.* sample - What do we mean by "statistical significance?" Hypothesis testing (*e.g.,* *t* tests) - Null hypotheses *v.s.* alternative hypotheses - Left-tailed, right-tailed, and two-tailed - Type I *v.s.* Type II error Confidence intervals --- # Midterm Topics ## 4. Multiple Linear Regression: Estimation OLS mechanics and properties Goodness of fit - `\(R^2\)` interpretation (literal) - Know the behavior of `\(R^2\)` as the number of explanatory variables increases. Make predictions for certain values of the explanatory values (*e.g.,* hedonic modeling) --- # Midterm Topics ## 4. Multiple Linear Regression: Estimation (cont.) Coefficient interpretation (literal and substantive) Omitted-variable bias - Know when omitting a variable causes bias. - Sign the bias. - Back out correlations between explanatory variables. --- # Midterm Topics ## 5. Multiple Linear Regression: Inference Confidence intervals and *t* tests - Other than degrees of freedom, same as before. Multicollinearity - Standard errors depend on the overlapping variation between the explanatory variable. - More overlap `\(\implies\)` bigger standard errors `\(\implies\)` less likely to reject null hypothesis. Irrelevant variables -- **No *F* tests on the midterm!** Stay tuned for the final. --- # Midterm Topics ## 6. Regressions in .mono[R] Write the code that generates regression output - I provide the console or R Markdown output and the name of the data file. - You provide the code that loads the necessary packages, imports the data, runs regressions, and generates a table. - Write the code as if it's in a .mono[.R] script. --- # Midterm Structure ## Fill in the Blank - 10 blanks - 3 points per blank (30 points total) ## True or False - 5 questions - 6 points per question (30 points total) - Brief explanations required for full credit ## Free Response - 4 multi-part questions with varying numbers of points (140 points total) - Explanations required for full credit --- # Midterm Protocol ## Materials - Writing utensil - 3-inch-by-5-inch note card - Basic or scientific calculator (no graphing or programming capabilities) - .hi[Nothing else] ## Procedure - **Randomized** seating chart .red[(penalty for non-compliance)] - 80 minutes from *"you may begin"* to *"pencils down"* - First 30 minutes: .hi[quiet period] (no questions, no getting up) - Last 50 minutes: ask lots of questions --- class: inverse, middle # Practice --- # Regression Table ## Example: Final Grades Data on 680 students in an introductory microeconomics class. <table> <caption>Outcome: Final Exam Score (%)</caption> <thead> <tr> <th style="text-align:left;"> Explanatory variable </th> <th style="text-align:center;"> 1 </th> <th style="text-align:center;"> 2 </th> <th style="text-align:center;"> 3 </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> Intercept </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 22.7 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 21.8 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> -8.69 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.877) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.973) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (1.49) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> Classes Attended (%) </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 0.039 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.027 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.041 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.011) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.014) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.013) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> HW Turned In (%) </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.022 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.023 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.012) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.011) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> ACT Score </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.528 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.048) </td> </tr> </tbody> </table> --- count: false # Regression Table ## Example: Final Grades Data on 680 students in an introductory microeconomics class. <table> <caption>Outcome: Final Exam Score (%)</caption> <thead> <tr> <th style="text-align:left;"> Explanatory variable </th> <th style="text-align:center;"> 1 </th> <th style="text-align:center;"> 2 </th> <th style="text-align:center;"> 3 </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> Intercept </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 22.7 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 21.8 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> -8.69 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.877) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.973) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (1.49) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> Classes Attended (%) </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.039 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 0.027 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.041 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.011) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.014) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.013) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> HW Turned In (%) </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 0.022 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.023 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.012) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.011) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> ACT Score </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.528 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.048) </td> </tr> </tbody> </table> --- count: false # Regression Table ## Example: Final Grades Data on 680 students in an introductory microeconomics class. <table> <caption>Outcome: Final Exam Score (%)</caption> <thead> <tr> <th style="text-align:left;"> Explanatory variable </th> <th style="text-align:center;"> 1 </th> <th style="text-align:center;"> 2 </th> <th style="text-align:center;"> 3 </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> Intercept </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 22.7 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 21.8 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> -8.69 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.877) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.973) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (1.49) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> Classes Attended (%) </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.039 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.027 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 0.041 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.011) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.014) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.013) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> HW Turned In (%) </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> 0.022 </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 0.023 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> (0.012) </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.011) </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;line-height: 110%;font-style: italic;color: black !important;"> ACT Score </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;line-height: 110%;font-weight: bold;"> 0.528 </td> </tr> <tr> <td style="text-align:left;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-style: italic;color: black !important;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;"> </td> <td style="text-align:center;color: #23373b !important;color: #c2bebe !important;line-height: 110%;font-weight: bold;"> (0.048) </td> </tr> </tbody> </table>