[SOLVED] R graph Go To access big assignment 5 please click on the link below:

$25

File Name: R_graph_Go_To_access_big_assignment_5_please_click_on_the_link_below:.zip
File Size: 649.98 KB

5/5 - (1 vote)

To access big assignment 5 please click on the link below:
https://r.datahub.berkeley.edu/hub/user-redirect/git-pull?repo=https%3A%2F%2Fgithub.com%2Fds- modules%2FENVECON-118&urlpath=tree%2FENVECON-118%2FFall- 19%2FProblem%2520Set%25205%2FPS5_Template.ipynb

EEP/IAS 118 Problem Set 5
Submit materials as one combined pdf on Gradescope. All work can be completed in this notebook. Make sure to run ( shift + enter ) all your answer cells before submission to make sure all your output is displayed.
Answers that only provide an estimated coefficient values without the code/output from which it was obtained will lose points.
R Tips
You can type ?function() for a given function and execute the cell to receive a popup of documentation on that function.
If used after a regression with the lm() command that you name reg_name , running
reg_name$fitted.values will output a vector of fitted values ( ) that is in the same order as the observations in your dataset (i.e. the first fitted value corresponds to the first observation in your data).
The function lm.beta() in the package lm.beta will let us run standardized regressions. First, run the regression per usual using lm() , saving it to memory as reg_name . Then,
run lm.beta(reg_name) to get the standardized version. If you execute it without saving to memory, you will obtain a regression table for the standardized variables, and if you save it to memory as reg_name_beta you can access the coefficients with
reg_name_beta$standardized.coefficients .
cor(var1, var2) prints the matrix of correlation between the two variables var1 and var2 .
^y

Exercise 1. The Effect of Minimum Wage on Employment Difference-in-Differences
Background
In this exercise, we are going to replicate the results of a classic paper in the labor economics literature. This paper answers a very important (and often controversial!) question in economic policy: does increasing the minimum wage increase unemployment (or conversely, reduce employment)? Proponents of minimum wage laws point to the benefits for individuals who remain employed in low wage jobs. Opponents of minimum wage laws argue that the increases in labor costs result in higher unemployment because employers hire less employees to offset the cost increases. Card and Krueger (1994) test this latter hypothesis using the minimum wage increase in New Jersey that went into effect in 1992. They surveyed fast food establishments in New Jersey and Pennsylvania both before and after the policy came into effect, collecting information on wages, employment and prices. While the interviews all occurred in 1992, the post-period interviews are coded as 1993 in your data for the sake of simplicity. This data is then used to obtain a difference- in-differences estimate of the effect of minimum wage laws on employment.
The dataset is saved as Card_Krueger_PS5.dta and contains the following variables:
Variable Name
Description
Unique Store ID Year Dummy =1 if store is located in New Jersey, =0 for Pennsylvania Dummy =1 if store is located on New Jersey Shore, =0 otherwise Number of full-time employees in a store Number of part-time employees in a store Number of managers in a store Starting wage in a store Price of an entree Number of full-time equivalent employees in a store ( )
Preamble
When writing R code, it can be helpful to include a preamble in your script where you load in your data and all the packages youll use throughout the entire problem set. Go ahead and use the below code cell to load in your dataset (assign it any name youd like), and load the packages youll be using (well at least need tidyverse and haven).
srgmn + tppme5.0 + tfpme etf eertnep
ts_egaw srgmn
tppme tfpme erohs
etats raey di_erots

In [10]:
# Add your preamble code here.
Question 1.
Generate a summary table with two columns and two rows. There should be two columns: one for New Jersey (Treatment column) and one for Pennsylvania (Control column) and two rows: one for the pre-period (year 1992), one for the post-period (years 1993). Within each cell, compute the mean number of full-time equivalent
employees (the variable ).
In [1]:
Add your written answer for Question 1 here.
Question 2.
State the difference-in-differences estimator for the change in full- time equivalent employees in terms of the following quantities
, where refers to the mean of
. Using the means reported in part 1, calculate a value for the estimator you just proposed.
In [8]:
Add your written answers for Question 2 here.
Question 3.
Lets proceed with estimating the difference-in-differences estimation via a regression:
(a) Write an equation that will give you the difference-in-differences estimator for the impact of the minimum wage increase on full time equivalent employees.
In [7]:
# Input code for Question 1 here.
# Input any code for Question 2 here.
# Insert any code for 3a here.
Add any written answer for 3a here.
etfY t s o p , n n e PY , e r p , n n e PY , t s o p , J NY , e r p , J NY
etf

(b) Give the economic interpretation of
Add any written answer for 3b here.
(c) Perform the estimation. You will need to generate two of the necessary right hand- side variables.
In [6]:
Add any written answer for 3c here.
(d) What do you conclude from the results of your estimation? Confirm that the results in this part are approximately the same as those in Question 2.
In [5]:
Add any written answer for 3d here.
Question 4.
In this question, we will explore the identifying assumptions for the difference-in-differences estimator.
(a) What key assumption do you need to make for your regression in part 3 to estimate the causal effect of minimum wage laws?
Add your written answer for Question 4a here.
(b) What additional data might you need to provide evidence for this assumption?
Add your written answers for Question 4b here.
(c) Draw a graph showing changes in full time equivalent employees ( ) that would provide evidence that this identifying assumption is satisfied.
# Insert any code for 3c here.
# Insert any code for 3d here.
etf
3 ,2 ,1 ,0

In [2]:
# Include your code for Question 4c here.
Add any written answers for Question 4c here.
Question 5.
Run the regression in Question 3(c), but instead using only full-time employment ( ) as your outcome variable. Report your results,
and interpret your estimates of .
In [8]:
Add any written answers for Question 5 here.
Question 6.
Lets say that we wanted to estimate the effect of minimum wage laws on full-time employment ( ), but we only had data from
New Jersey. Using a simple difference in means, estimate and interpret the effect of minimum wage laws on full-time employment in New Jersey. Make sure to test for significance.
In [4]:
Add any written answers for Question 6 here.
Question 7.
In no more than 3 sentences, compare your conclusion in part 5 to your conclusion in part 6. If you draw different conclusions from the results of part 5 and part 6, what might explain this difference (i.e., why is the difference-in-differences estimator preferable)?
In [7]:
Add any written answers for Question 7 here.
# Include your code for Question 5 here.
# Include your code for Question 6 here.
# Include any code for Question 7 here
tfpme
3
tfpme

Question 8.
Run the regression in part 3, limiting the New Jersey observations to those not located in the New Jersey Shore.
(a) Report your results and compare them to those obtained in part 3.
In [4]:
Add your written discussion for Question 8a here.
(b) In no more than two sentences, explain why you might want to impose this restriction. Think about differences between the rest of New Jersey and the Jersey Shore.
Add your written discussion for Question 8b here.
# Type any code for Question 8a here

Exercise 2: Schoolbus Replacements and Attendance Panel Regression
Background
In this problem, we will look at the effect of replacing highly-polluting school buses on students health. Many school districts in California, particularly less wealthy school districts, have school buses that are many decades old. These buses do not have many of the pollution controls that are now standard in vehicles, exposing the students that ride them to high concentrations of pollutants. In 2006, the state of California passed a proposition that allocated funds towards replacing the oldest of these school buses with new models that had adequate pollution controls. We have data for these replacements for the years 2009-2012, with the number of replacements per year more or less increasing over the sample period. This data is combined with attendance data from all school districts in California over the same period to test the impact of reducing pollution exposure through bus replacements on student health. Attendance is used to measure student health because students who are chronically ill are often absent from school. The full dataset is described in detail below.
The dataset Schoolbuses_PS5.dta is an unbalanced panel of 209 school districts for the years 2009-2012, and contains the following variables:
Variable Name
Description
Unique School District Identifier Year Number of Buses Replaced Percent of students in attendance Numberof students in the Gifted Student Program Number of White Students Number of Students with Parents that Attended College Number of Students from Higher Socio-Economic Backgrounds Number of Buses in the District Fleet Average Number of Students Traveling per Day Number of Students Enrolled in the District
tnemllorne snart_slipup ezis_teelf dgtvda egelloc etihw
detfig ecnadnetta ecalper_sub raey edoc_tcirtsid

Question 1.
Briefly describe the data that you have : a) How many school districts? b) How many years? c) Report the mean, sd, min and the max of the following variables: number of buses replaced, number of students enrolled, and fleet size.
In [ ]:
Add your written answer for Question 1 here.
Question 2.
You think that it might be important to control for the year in your regression of attendance on bus replacements. First, generate year
# Add Code for Question 1 here.
dummy variables
following equation for school attendance.
(a) Estimate the model and report your results.
In [15]:
Add your written answer for part (a) here.
(b) Give the meaning (economic interpretation) of
Add your written answer for part (b) here.
(c) Interpret (SSS) your estimate for .
. Next, estimate the
# Add your code for part (a) here.
Add your written answer for part (c) here.
and
1 0
tiu + 2102ry3 + 1102ry2 + 0102ry1 +
tidetfig5 + tidgtvda4 + tiegelloc3 + tietihw2 + tiecalper_sub1 + 0 = tiecnadnetta
) 2102ry , 1102ry , 0102ry , 9002ry(
1

(d) Why is the year 2009 dummy excluded?
Add your written answer for part (d) here.
Question 3.
Consider now the following (unobserved) fixed effects model:
(a) What is the interpretation of the vector of fixed effects terms ?
Add your written answer for part (a) here.
(b) Why are we adding these fixed effects, as opposed to estimating model (2)? In other words, what do these fixed effects control for in the regression?
Add your written answer for part (b) here.
(c) Interpret (remember SSS)
Add your written answer for part (c) here.
(d) Comment specifically on how the size of changes from model (2) to model (3) and explain why you might have expected it to go in this direction.
Add your written answer for part (d) here.
Question 4.
What are the assumptions necessary for the parameters of model (3) to be unbiased? Do you think they are likely to hold? Whatever position you take, give your argument.
1^
ia
tidgtvda4 + tiegelloc3 + tietihw2 + tiecalper_sub1 + 0 = tiecnadnetta
)2( tiu + ia + t + tidetfig5 +
1^

Add your written answer for Question 4 here.
Downloading your Notebook
Download a PDF copy of your notebook by using File > Download as > PDF via Chrome (.pdf). It does not matter what browser you are using, you can use this command to download a copy of your notebook while on Chrome/Firefox/Opera/Edge/Safari/heck probably even Internet Explorer or Netscape Navigator.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] R graph Go To access big assignment 5 please click on the link below:
$25