代写program课程作业、Java课程作业代做、代写c/c++，Python程序设计作业 代做R语言编程|代写R语言程序

Question 4 (25 points)
We saw in class that endogeneity leads to a violation of A1. In this question, we will work with a
reduced form model to illustrate the problems. Throughout this question, we will work with the
following regression model:
y = β0 + β1x + ε
Where β0 = 1.5, β1 = 2, Cov(x, ε) 6= 0. Let x and ε be distributed as:
is the vector of means for x and ,
is the variance-covariance matrix between
x and . Hint: To draw from a multivariate normal distribution, you can use the package mvtnorm,
and install it with the command install.packages(’mvtnorm’). Then use the command rmvnorm
to draw (note that you have to specify the mean and the variance in order to be able to draw.
a. First, show analytically what the OLS estimator of β1 converges to (do the derivations and
provide a number). Then, for N = 50, 100, 200, run 2, 000 simulations and plot the simulated
distributions on the same histogram.1 Are your simulations in line with your analytical
derivation?
Now, imagine we have a new variable we claim to be an instrument for x, say z. Let’s assume the
following:
x = γ0 + γ1z + ε + ν
y = β0 + β1x + ε
where γ0 = 0.5, γ1 = 1.
b. Prove formally that z is a valid instrument.
1You can check out the snippet of ggplot2 in the files for the first recitation.
5
c. Now, for N = 50, 100, 200, run 2, 000 simulations. For each sample size, plot a histogram with
both estimators (IV and OLS), calculate their mean, and their standard errors. How do you
interpret your simulations results using the theory that we have studied?
d. Suppose now that γ1 = 0.00001. Is the instrument valid? Why/why not? For N = 50, 100, 200,
run 2, 000 simulations, plot the simulated distributions of the IV estimator and comment on
the results. Is what you find in line with the theory?
e. You want to test for whether the instrument in point (d) is weak. To do that, you code
your own Weak Instrument test. Then for N = 50, 100, 200, run 2, 000 simulations where you
store the decision of the Weak Instrument Test assuming a significance level α = 0.05 (hint:
compute the test statistic, compute the p-value, compare it to the significance level, and save
it as 1 if you reject the null, and repeat...). Construct a table reporting the percentage of the
time you conclude the instrument is weak for each sample size (i.e. 50, 100, 200). Can you
make sense of your finding?
6

• QQ：99515681
• 邮箱：99515681@qq.com
• 工作时间：8:00-23:00
• 微信：codinghelp