<jupyter_start><jupyter_text>Indicate the Following: Name: _____________________  SID: ________________________  Exam Instructions*	This exam will be made available on May 11 at 9:00pm pacific time. *	It MUST be submitted to [Gradescope](https://www.gradescope.com/courses/353120) before May 12th end of day pacific 11:59pm, NO EXCEPTIONS. Submit early enough to deal with any unforeseen technical issues that may arise while submitting. Make sure to **select the page(s) that correspond to each problem part!***	This exam should be solved in two hours (three hours max).  Upload it to Gradescope once you are done. Do not dither and spend too much time/energy on the exam, it will not improve your grade. * To receive full credit, answers must include a correct answer, demonstrate all steps used to obtain the answer, and round to **four decimal places** unless otherwise indicated.* Final written answers **must be placed in the indicated text/Markdown cell**. Text/comments in coding cells can easily be cut off when exported as a pdf and will not be used as answers when grading. R output provided without words or indication are not considered complete answers.* This exam **does not require R**. R may be used as a calculator or to obtain critical values from statistical tables, but no credit will be given for the use of confidence interval or hypothesis test functions. If R is used to complete steps on a problem, make sure to include the utilized code/output along with your written text answers.*	We are looking for concise accurate responses and explanations. Long wishy-washy responses will not work to your advantage. * If submitting photos of your handwritten exam, make sure the photos are clearly visible and centered on the page. Your pictures should look the same as if we had run your exam through a scanner.* This is an open book exam; you may use all your notes and materials from the course. Honor Code Statement: "As a member of the UC Berkeley community I act with honesty, integrity, and respect for others.”**This is an individual exam.  Cases of collaboration/copying will be given scores of zero.**Please print your name below to indicate that you understand that this exam is to be completed alone, without outside assistance, and that you understand the penalty for failing to do so: **Printed Name:**    Final 2022 - EEP/IAS 118 - Villas Boas 100 Points Total (5 Exercises, 20 points each)  Exercise 1. (20 Points)We estimate the following model where $price_{jt}$ is the price of house *j* in year *t* and is a function of the distance to the nearest recreation park using a dataset with 578 observations. In particular, the variable in the model is measured as the difference between the distance of each house to the park and 150 yards.The OLS regression line is$$\widehat{price_{jt}} = 850000 + 164(distance_{jt}-150)$$$$(150000)~~~(41)~~~~~~~~~~~~~~$$Where standard errors of the estimated coefficients are in parentheses. **a) (2.5 Points)** Please construct a 95% confidence interval of the predicted average price of a house that is located 150 yards from the nearest park. ➡️ Written Solutions for Ex 1a<jupyter_code># Include any code used for Ex 1a here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**b) (2.5 Points)** Do you find evidence that distance increases predicted prices at the 10 percent significance level for a one-sided alternative? Do all 5 steps in hypothesis testing. ➡️ Written Solutions for Ex 1b<jupyter_code># Include any code used for Ex 1b here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**c) (5 Points)** When we predict prices and perform the correlation of actual and predicted prices we obtain a value of 0.48. What is the regression’s goodness of fit measure adjusted R-squared’s value? Round all calculations and final answer to **4 decimal places**. ➡️ Written Solutions for Ex 1c<jupyter_code># Include any code used for Ex 1c here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**d) (5 Points)** We run the regression of prices on (distance-150) and add the house size (measured in square feet) to the regression. We note that the coefficient on house size is 5.3 with a standard error of (1.2). Moreover, in that regression, the estimated coefficient of (distance-150) is now 60 with a standard error of (20). What does this tell you in terms of the correlation between the variable (distance-150) and the variable size of the house? ➡️ Written Solutions for Ex 1d<jupyter_code># Include any code used for Ex 1d here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**e) (5 Points)** We wish to test the null hypothesis that the coefficient on “distance-150” is equal to 56 and the coefficient on “house size” is equal to 2 at the 5% level. Please perform the 5 steps in hypothesis testing and conclude, given that the Residual standard error from the unrestricted regression is 1.3784 and the Sum of Squared Residuals (SSR) for the restricted regression is 1350.  ➡️ Written Solutions for Ex 1e<jupyter_code># Include any code used for Ex 1e here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>Exercise 2. (20 Points)A recent study at Lawrence Berkeley National Lab estimated the indoor air quality impacts of natural gas stoves (gas stoves emit pollutants that can exacerbate respiratory issues such as asthma and affect health in multiple ways). After reading the article, you wish to measure the impact directly. You discover that a sample of 614 homes in Phoenix, Arizona was affected by a quasi-experiment. In January 2020, half of the homes were required to replace their natural gas stoves with an electric-powered induction cooktop that doesn’t affect indoor air quality. The other half of homes, located in a different neighborhood, were not required to change stoves and kept their natural gas stoves. You obtain data from the Arizona Department of Environmental Quality (ADEQ) on average indoor air quality for the 614 homes for 2019 and 2020. You are also provided with additional data on household size, family income, and other home characteristics (square footage, information on other appliances, etc.) **a) (5 Points)** Below is a table showing the average indoor air quality index (AQI) in 2019 and 2020 for homes that replaced their gas stoves with low-emission cooktops and those that were not affected by the policy. Please complete all the missing pieces in this table. Show any work in the cells below and **write all missing pieces at the start of the corresponding cells below the table**. | Average Indoor Air Quality | Replaced=0 | Replaced=1 |	Difference (Rep-Not Replaced) || :--------------------- | :------- |--------- | :------ || 2019                   |    (i)   |    47    |    4    ||||||| 2020                   |    39    |    27    |   (ii)   ||||||| Difference (2020-2019) |    (iii)   |   (iv)    |   (v)   |  ➡️ (i) =  ➡️ (ii) =  ➡️ (iii) =  ➡️ (iv) = ➡️ (v) =<jupyter_code># Include any code used for Ex 2 (i)-(v) here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**b) (6 Points)** Below is the equation we estimate to measure the causal effect of gas stove removal on   indoor air quality:$$ \widehat{AQI} = \hat{\delta_0} + \hat{\delta_1}  Year2020 + \hat{\delta_2} Replaced + \hat{\delta_3} Replaced*Year2020 $$Where *Replaced* is a dummy variable =1 for homes that replaced their gas stoves with induction cooktops, and *Year2020* is a dummy variable =1 for Year 2020. What are the values of all the estimated coefficients in this equation given what you know in a)? Place your answers next to the coefficients, followed by your work in the cells below. ➡️ $\hat{δ_0}$ =  ➡️ $\hat{δ_1}$ = ➡️ $\hat{δ_2}$ =  ➡️ $\hat{δ_3}$ =<jupyter_code># Include any code used for Ex 2(b) here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**c) (2 Points)** Which coefficient above tells us the difference-in-differences treatment effect estimate? What is its value? ➡️ Written Solutions for Ex 2c **d) (2 Points)** 	ADEQ sent you the following plot showing the average indoor air quality from 2009 to 2019 for Phoenix-area homes that had their stoves replaced (Replaced) and those that didn’t (Not Replaced). In **2 sentences max**, state whether or not you believe that the key identifying assumption for this impact analysis method is likely to hold given the information in the plot.  ➡️ Written Solutions for Ex 2d **e) (2 Points)** While discussing program details, ADEQ informs you that all homes in the neighborhood where gas stove replacements occurred are newer than the homes that didn’t have their stoves replaced. They tell you that these newer homes have higher quality ventilation systems that result in better average indoor air quality (lower AQI) than in control homes. Explain in a maximum of two sentences whether this difference in ventilation system quality between treated and control households would violate our identifying assumption. ➡️ Written Solutions for Ex 2e **f) (3 Points)** Suppose you were able to conduct a randomized control trial with an additional 500 Phoenix-area homes in which you randomly assign half of the homes to receive low-emission induction cooktops and the other half to retain their gas stoves. To estimate the effect of stove replacement on indoor air quality, you estimate the following model:$$ \widehat{AQI} = \hat{\beta_0} + \hat{\beta_1}  Treated + \hat{\beta_2} Multistory + \hat{\beta_3} Sqft + \hat\beta_4 Bdrms + \hat\beta_5 HHsize $$Where *Treated* is a dummy variable =1 for treated homes, *Multistory* a dummy variable =1 for homes with 2 or more floors, *Sqft* the indoor square footage, *Bdrms* the number of bedrooms, and *HHsize* the number of family members living in the home.**TRUE or FALSE**: failing to control for home characteristics like multiple stories, square footage, bedrooms, and household size will introduce omitted variable bias on $\hat\beta_1$ as these variables are important for determining indoor air quality levels. **State TRUE or FALSE** and **explain in a maximum of two sentences**. ➡️ Written Solutions for Ex 2f  Exercise 3. (20 Points)In a country (outside the US), high school graduation is determined by scores on a high school exit exam. The passing grade is 50, so all students getting a grade 50 or above graduate from high school and can move to any higher education institution of their choice. Students getting (strictly) below 50 can choose to retake the exam the year after or drop out entirely of the school system. This graph shows the relationship between the high school exam score (the first time you take the exam) on the horizontal axis and the probability of being unemployed by age 35 (in percentage points) on the vertical axis.  **a) (5 Points)** Which model would you use to estimate the treatment effect? (justify your choice in **a maximum of 2 sentences**). Write the population regression equation corresponding to this regression discontinuity design, with the following instructions.   * Denote the running variable as $Score_i$, the outcome as $Unempl_i$, and the threshold as 50.    * Write your equation in such a way that $\beta_1$ is the coefficient of interest ➡️ Written Solutions for Ex 3a **b) (5 Points)** 	Using the numbers on the graph, interpret the treatment effect $\beta_1$ (assume that the coefficient is statistically significant at all conventional levels) and interpret the intercept $\beta_0$ ➡️ Written Solutions for Ex 3b<jupyter_code># Include any code used for Ex 3b here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**c) (6 Points)**  **TRUE or FALSE:** Instead of only using the scores from the first time a student has taken the exam, I decide to use any score a student has ever received at this exam to maximize my sample size around the cutoff. My advisor says I should not run such a regression. Do you agree with him?**State YES or NO** and **explain in a maximum of four sentences.** ➡️ Written Solutions for Ex 3c **d) (4 Points)** The dataset also contains other information, such as basic demographic and socioeconomic data and family background. To ensure that the effects we are measuring are indeed causal, can you test for the validity of the identification assumption? If yes, please specify which test you would conduct. ➡️ Written Solutions for Ex 3d  Exercise 4. (20 Points)Approval of Presidents, in percentage points, can be affected by economic conditions.  The following model uses data on presidential approval rates in percentage points, ranging from 0 to 100, and unemployment rates (from 0 to 100 percentage points) for 50 US states for two years. $$ ApprovalRate_{jt} = \alpha_0 + \alpha_1 state_1 + \alpha_2 state_2 + ... + \alpha_{50} state_{50} + \beta unemp_{jt} + \gamma Year_2 + \epsilon_{jt}$$ **a) (3 Points)** Can you estimate all coefficients $\alpha_0, ~\alpha_1,~ \alpha_2,~ \alpha_3,~...,~\alpha_{50},~ \beta,~\gamma$ by OLS? Why or why not? Explain briefly with reference to collinearity. ➡️ Written Solutions for Ex 4a **b) (4 Points)** What is the variable $Year_2$ in this regression? Please define it and explain what it looks like in the data set.  ➡️ Written Solutions for Ex 4b **c) (5 Points)** Please interpret the meaning and statistical significance of the OLS estimate $\hat{\gamma}$ = -3.3 with a standard error of 0.8. (2-3 sentences max) ➡️ Written Solutions for Ex 4c<jupyter_code># Include any code used for Ex 4c here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**d) (5 Points)** Please interpret the meaning and statistical significance of the OLS estimate $\hat{\beta}$ = -7.2 with a standard error of 2.5. (2-3 sentences max) ➡️ Written Solutions for Ex 4d<jupyter_code># Include any code used for Ex 4d here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output><jupyter_text>**e) (3 Points)** Please explain why a coefficient on a dummy for the West Coast States cannot be estimated in the model specified in this exercise.  (2 sentences max) ➡️ Written Solutions for Ex 4e  Exercise 5. (15 points)We next want to understand the probability of individuals earning more than a minimum wage in a sample. The R output below corresponds to the linear probability model of individuals earning more than the minimum wage as a function of whether individuals have a college degree (*college*=1 or 0),  whether the individual is white (*white*=1 or 0), the individual's age, and age squared.       **a) (2 Points)** What is the estimate of the robust standard error for the *white* parameter? ➡️ Written Solutions for Ex 5a **b) (3 Points)** Please interpret whether having finished college significantly affects the probability of earning more than the minimum wage, controlling for age, age squared, and being white or not. ➡️ Written Solutions for Ex 5b Next, please consider the output below that estimates a matching logit model and the corresponding marginal effects. **c) (5 Points)** Please construct a 90 percent confidence interval for the average marginal effect  (AME) of being white on the probability of earning more than minimum wage, controlling for age, age squared and having finished college.  ➡️ Written Solutions for Ex 5c<jupyter_code># Include any code used for EX 5c here. (Coding Cell) Final answers do not belong in this cell.<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07116057233704293, 'fraction_numerical': 0.021176470588235293, 'mean_word_length': 4.566725663716814, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '121926', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 4275, 'n_tokens_neox': 3949, 'n_words': 2384, 'path': 'Final/Final_2022.ipynb', 'repo_name': 'ds-modules/ENVECON-118-SP22', 'size': '15725'}