Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

1 Assignment 2 EC655 – Fall 2021 Due: Monday, November 8, 9:00pm Assignment Description In this assignment you are asked to manipulate data, estimate statistical relationships, and interpret the...

1 answer below »
1
Assignment 2
EC655 – Fall 2021
Due: Monday, November 8, 9:00pm
Assignment Description

In this assignment you are asked to manipulate data, estimate statistical relationships, and
interpret the findings. The questions below guide you through the process of statistical estimation.
It will be useful for you to use the “help” function in Stata, and/or to look up the command in the
Stata reference manuals (which are available within Stata as PDFs), or Google, or back in the
lecture notes. You are also, as always, welcome to ask me for help.

I strongly suggest that you start this assignment early because it will not be possible (in my
opinion) to do well if you start close to the due date. There are parts that you may find difficult;
you will want to identify them and leave enough time to ask questions if necessary.

Assignment Instructions

Data analysis

In mylearningspace, you will find a dofile called “EC655 assign2 dofile.do” that contains some code
you need to complete the assignment. All students must use this file to generate their data and
write the code to answer the questions. Before using the dofile, you need to do the following:

- Rename the file from “EC655 assign2 dofile.do” to your family name followed by your
student number (no spaces)
- After log using, replace [INSERT YOUR LAST NAME AND STUDENT NUMBER HERE]
with your last name and student number, with no space between the two. Do not
emove the quotation marks
- After set seed, replace [INSERT YOUR STUDENT NUMBER HERE] with your full student
number.

Leave all other commands that cu
ently exist in the dofile untouched. Write your code to answer
the questions inside the dofile.

Note that this file generates random data depending on your student number, so each student’s
data will be different, and therefore answers will also be different.









2
Submission

You are required to submit three documents according to the following instructions:

a) A report containing your answers to all the questions. I outline below how I would like
your report to look. The overall goal is that the answers to each question must be easily
identifiable in a readable, professional-looking document. Hand in the report in
Gradescope and the MyLearningspace Dropbox;
) Stata dofile. Hand in to the MyLearningspace Dropbox only;
c) Stata log file. Hand in to the MyLearningspace Dropbox only.

In the report described in (a) above, please answer all questions in the same order as they are
stated on the question sheet. For each question and sub-question, include the relevant Stata code
(if any) that you used, the output generated by that command if there was any, and an
interpretation if you are asked to provide it. For example, if you were answering the following
hypothetical question, it might look like this:

************************************************************************************************
1) Using the tab command, provide a frequency distribution for y

Stata commands:

tab y;

Output:


XXXXXXXXXXy | Freq. Percent XXXXXXXXXXCum.
------------+-----------------------------------
XXXXXXXXXX | 23, XXXXXXXXXX XXXXXXXXXX
XXXXXXXXXX | 138, XXXXXXXXXX XXXXXXXXXX
XXXXXXXXXX | 9, XXXXXXXXXX XXXXXXXXXX
XXXXXXXXXX | 63, XXXXXXXXXX XXXXXXXXXX
XXXXXXXXXX | 2, XXXXXXXXXX XXXXXXXXXX
------------+-----------------------------------
Total | 237, XXXXXXXXXX
************************************************************************************************
You could also format your own output tables rather than copying and pasting Stata output from
your log file if you find it easier. The key is that as long as the questions are answered in order,
and the Stata commands used for each question and associated output are clear, it will be fine.

A note on plagiarism: this is an independent assignment, which I expect you to complete on
your own. It is plagiarism to copy someone else’s work ve
atim, which includes Stata
dofiles. Any work you submit should be yours only.





3


Ec655 assign2 dofile.do creates simulated data on wages ($ per hour), years of completed
schooling, and years of experience, for 3000 observations. The data are fake, but are meant to
oughly match a real US dataset, and so the conclusions you reach here will be at least
somewhat connected to reality. Each question is worth 5 points, for a total of 40.


1) Explain the data generating process given in the code, highlighting in particular any implied
assumptions.

2) Create the simulated data using the provided code and draw a contour plot of your data for
wage, education, and experience (see the twoway contour command in Stata). Interpret your
findings.

3) Simulate the bias in the regression of wage on education (excluding experience). Use 1000
eplications in your simulations, and report the kernel density estimate of the bias and the
mean of the bias. Explain your results fully.

4) Create a new instrumental variable called z that meets the two criteria for a valid instrument.
Verify that the two conditions are met.

5) Estimate the relationship between wages and education by two-stage least squares, using z as
an instrument for education. How does the estimated slope from this regression compare to
the true causal effect and to the biased estimate from (3)?

6) Estimate the first stage regression of education on z, and save the residuals. Then estimate the
egression of wages on education and those residuals. Explain intuitively why the slope on
education is the same as in (5).

7) Simulate the sampling distribution of the two-stage least squares estimator in (6). Use 1000
eplications in your simulations, and report the kernel density estimate of the distribution of
the slope and the mean of the slopes. Explain your results fully.

8) Create 100 new instruments (call them w1 – w100) that are each a normally-distributed
andom variable with mean zero and standard deviation 10. Estimate the slope on education
y two-stage least squares using all one-hundred instruments in the same first stage. Explain
your results.





***EC655 Fall 2021
***Assignment 2 Dofile
cap log close
log using "[INSERT LAST NAME AND STUDENT NUMBER HERE].log", replace
clear all
set obs 3000
set seed [INSERT STUDENT NUMBER HERE]
gen educ = round(rnormal(13,3),1)
gen exper = 22 - 1*educ + rpoisson(3)
gen u = exp(rnormal(0,ln(2)))
    egen mu = mean(u)
    replace u = u-mu
gen wage = XXXXXXXXXX*educ + 0.25*exper + u

Last name/Family Name: Wang
Student Number: XXXXXXXXXX
Answered 6 days After Nov 02, 2021

Solution

Komalavalli answered on Nov 08 2021
127 Votes
1. Data is generated using the code set seed and student number which is used for random number generation. Therefore the data is generated through random number generation and the code is set seed 215812590.
2. Contour plot
The above contour plot suggests that people having higher education with less experience earns more wage while people having more experience combined with less education earns lesser wage.
3. Regression output
Source | SS df MS Number of obs = 3,000
-------------+---------------------------------- F(1, 2998) = 1180.39
Model | 1535.82555 1 1535.82555 Prob > F = 0.0000
Residual | 3900.75504 2,998 1.30111909 R-squared = 0.2825
-------------+---------------------------------- Adj R-squared = 0.2823
Total | 5436.58059 2,999 1.81279779 Root MSE = 1.1407
------------------------------------------------------------------------------
wage | Coef. Std. E
. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .2400242 .0069862 34.36 0.000 .2263259 .2537225
_cons | 2.382592 .0932847 25.54 0.000 2.199683 2.5655
y = β0+β1x1+β2x2
y = 2.38+0.24 x1
y – wage
x1 – education
This result suggests that there is a positive relationship between wage and education. The variable wage is statistically significant at 5% level of significance. R square value of this model is 0.28 which indicates the 28% variation of the model is explained by the explanatory variable.
Kernel density of wage
The above graph indicates the distribution of wage is standard normal distribution    
Kernel density of education
The above graph indicates the distribution of education is standard normal distribution    
4. To check whether z meets the two criteria of instrument variable, I used co
elation matrix.
Co
elation matrix
| z _est_r~l educ
-------------+---------------------------
z | 1.0000
_est_resid~l | . .
educ | -0.8631 . 1.0000
from above result we can say that there is no co
elation between e
or term and z, there is high negative co
elation between education and z.
Therefore two criteria z is unco
elated with e
or term and z is co
elated with educations is satisfied.
5.
Source | SS df MS Number of obs = 3,000
-------------+---------------------------------- F(2, 2997) = 942.21
Model | 2098.73692 2 1049.36846 Prob > F = 0.0000
Residual | 3337.84366 2,997 1.11372828 R-squared = 0.3860
-------------+---------------------------------- Adj R-squared = 0.3856
Total | 5436.58059 2,999 1.81279779 Root MSE = 1.0553
------------------------------------------------------------------------------
wage | Coef. Std. E
. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
educ | .488348 .0127978 38.16 0.000 .4632547 .5134413
z | .2464608 .0109627 22.48 0.000 .2249656 .2679559
_cons | -3.805887 .2884796 -13.19 0.000 -4.371525 -3.240249
Instrumental variables (2SLS) regression
Source | SS df MS Number of obs = 3,000
-------------+---------------------------------- F(2, 2997) = 942.21
Model | 2098.73692 2 1049.36846 Prob > F = 0.0000
Residual | 3337.84366 2,997 1.11372828 R-squared = 0.3860
-------------+---------------------------------- Adj R-squared = 0.3856
Total | 5436.58059 2,999 1.81279779 Root MSE = 1.0553
------------------------------------------------------------------------------
wage | Coef. Std. E
. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
z | .2464608 .0109627 22.48 0.000 .2249656 .2679559
educ | .488348 .0127978 38.16 0.000 .4632547 .5134413
_cons | -3.805887 .2884796 -13.19 0.000 -4.371525 ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here