这是一个美国的Problem Set R语言代写,与数据分析统计相关

1 The Returns to Schooling or IQ? (8 points: 2 points each)

Many countries allocate a large budget to educational expenditures. Are these budgets justified?
In this question, you will work with unique data on wages, education and IQ.

You should use Stata or R to answer this question and include your code and log file in your
submission. Failure to submit code/log will result in a 0 on this question.

Refer to the datafile wage.csv available on Canvas. This dataset has the following variables:

1. Estimate the following bivariate regression model via OLS and interpret the size and signifi
cance of your estimates (i.e.,both βˆ0 and βˆ1).

wage = β0 + β1educ + u

2. Now, estimate the following bivariate model via OLS. Interpret the ˆ γ1 coefficient. Using
the regression result, discuss whether the model estimated in question (1) is likely to be an
unbiased estimate of the return to education. Why or why not?

educ = γ0 + γ1IQ + v

3. Now, estimate the following multivariate regression model via OLS. Has your estimate of βˆ1
changed from what you found in question (1)?

wage = β0 + β1educ + β2IQ + u

4. Create a new variable calculating the natural log of wage and name this variable lwage.
Construct a plot of the conditional expectation function (CEF) of hourly wages given years
of education, and compare this to a plot of the CEF of log hourly wages given years of
education. Re-estimate your regression in part (1) using lwage as given below and interpret
the β1 coefficient. Which model do you think better fits the data?

lwage = β0 + β1educ + u

2 Murder Rate and Executions (10 points: 2 points each)

Capital punishment is a highly controversial policy issue today. Proponents argue that capital
punishment has a strong deterrent effect. In this question, you will work with state-level data on
murder rates and capital punishment. You seek to estimate whether capital punishment reduces
murders.

You should use Stata or R to answer this question and include a code and log file in your submission.

Failure to submit code/log will result in a 0 on this question.

Refer to the datafile murder.csv available on Canvas, which reports data for 1996. This dataset
has the following variables:

1. Create (a) a new variable with the murder rate per 10,000 population (murderrate) and (b)
execution rate per 10,000 population (execrate).

What is the mean murder rate per 10,000 across all states? Which state has the highest
murder rate, and which state has the lowest? How many states had no executions in 1996?

What is the largest number of executions?

2. Estimate the effect of execrate on murderrate using OLS. Interpret the size and signifi
cance of your estimates. Does the estimated equation suggest a deterrent effect of capital
punishment?

3. Reestimate your model restricting to states that had at least one execution in 1996. How
does this affect your estimates?

4. Let’s try one more model. Create an 0/1 indicator variable for whether a state has any
executions within the year. You can think about this as a proxy for whether the state uses
the death penalty. Regress the murder rate on your new indicator variable. Does having
capital punishment in the state appear to be a deterrent for murders?

5. Do you think this simple regression analysis is suitable for estimating the causal effect of
capital punishment on the murder rate? Please explain.