CS计算机代考程序代写 final

final

Due: December 7, Tuesday @ 6 pm, CA Time

Consider the data file star_mod.csv . It contains information on student test scores
(totalscore) and an indicator of class size (size = 1 if the class size was small). We are interested
in measuring whether students in smaller classes obtain larger test scores. Additionally you
observe student demographics (boy, white_or_asian, black), teacher characteristics (tchexper –
teacher experience, tchmasters – teacher has a masters degree), school characteristics
(schurban – school is in urban location, schrural – school is in rural location).

Question 1 (2 points):
Regress tchexper on tchmasters, schrural and the interaction of tchmasters and schrural.
Answer this: Interpret the R2 of this regression.
Code requirement: Estimate the correct regression and print out the complete summary
(including coefficients, R2 and degree of freedom)

Question 2 (2 points):
Based on the results in Question 1, test whether teachers in rural schools are less experienced
at the 95% level.
Answer this: Write down H0, H1, compute test statistic and choose the appropriate cut-off value
for the sample size observed in the data. Then report the conclusion.
Code requirement: Show the complete test.

Question 3 (2 points):
Answer this: Based on the results in Question 1, what is the expected difference in experience
between teachers with a master’s degree in rural schools and teachers without a master’s
degree in rural schools? Please provide the correct number.

ECON 123A: ECONOMETRICS I
Takehome Final Project

~~~ PART 1: QUIZ ~~~

Question 4 (2 points):
Answer this: Based on the results in Question 1, what are the degrees of freedom of the test of
significance of the above regression model? Report 2 numbers.

Question 5 (2 points):
Compute the White (robust) standard errors for the model used in Question 1.
Answer this: Discuss whether you find strong evidence in favor of heteroskedasticity and
explain.
Code requirement: Re-run the model with robust standard errors or compute the robust standard
errors based on the previous estimated model.

Question 6 (2 points):
Answer this: Provide the value . What do
you conclude about the effect of class size on test scores?
Code requirement: First, get values for and ,
then get the difference .

Question 7 (2 points):
Answer this: Explain why the result described in Question 6 may be incorrect.

Question 8 (2 points):
Run a regression that shows whether or not students of different demographics were allocated
to small classes at random (include all 3 students’ demographics variables in the model).
Answer this: Explain if you think students are allocated randomly or not and why.
Code requirement: Choose the appropriate model to estimate based on the data provided. Then
estimate the model. Base your answer on the exact parameter estimates and discuss coefficient
sizes and significance.

Question 9 (2 points):
Run this regression:

Answer this: Compared with the results in Question 6, what changes do you observe based on
the regression results in this regression? Explain why this might have happened.
Code requirement: Run this regression and show its summary.

Question 10 (2 points):
You now add tchexper, tchwhite, tchmasters to your model in Question 9.
Answer this: Does this change the magnitude of the effect of class size on totalscore (compared
to the results in Question 9)?
Code requirement: Run the new regression and show its summary.

E(Totalscore|size = 1) − E(Totalscore|size = 0)

E(Totalscore|size = 1) E(Totalscore|size = 0)
E(Totalscore|size = 1) − E(Totalscore|size = 0)

totalscore = + size + boy + white_or_asian + blacka0 a1 a2 a3

Question 11 (2 points):
Answer this: In the model specification in Question 10, explain why you should treat these
variables as omitted variables or irrelevant variables (you have to identify if it’s omitted variables
problem or irrelevant variables problem).

Question 12 (2 points):
Answer this: Does this mean that tchexper, tchwhite, tchmasters are unrelated to the class size?
Explain.
Code requirement: Run appropriate regression to prove your statement.

You now find out that students were allocated at random to small class sizes but that some
students decided to switch classes. You are told that the variable small denotes whether or not a
student was allocated to a small class size. Recall that the variable size denotes whether or not
a student actually studied in a small class. This applies to Questions 13, 14, 15.

Question 13 (2 points):

Answer this: Argue that small is a STRONG instrumental variable for size in this specification.
Provide as much evidence as you can.
Code requirement: Run appropriate regression to prove your statement.

Question 14 (2 points):
Estimate the 2SLS regression model of totalscore on size using small as an instrument and
controlling for boy, white_or_asian, black, tchexper, tchwhite, and tchmasters.
Answer this: What do you conclude about the treatment effect of studying in a small class on
total scores?
Code requirement: You may use a package or simply use the 2SLS method to perform the IV
regression and then computing the correct standard errors.

Question 15 (2 points):
Show that size is an endogenous variable in the specification in Question 14 by performing the
Hausman test using an artificial regression.
Answer this: Provide t statistic on the appropriate variable and state your conclusion.
Code requirement: Follow the steps that you have learned during lecture to perform the
Hausman test.

There are 11 questions that require code. Each question is worth 2 points, in total 22 points for
Part 2.

< Code Requirements >

(1) Questions that require code: In Part 1, if a question has specified Code requirement, it
means that question requires you show the code and code output in Part 2.
(2) Identify which code corresponds to which question.

R users: label each question in .rmd file before knitting the code.
Stata users: label each quetsion in .do file before executing the code.
If you choose to screenshot, then label it in a word file.

(3) Comment your code: It is important to clarify the intention of each line of code and state what
you have observed relevant to the question from the code output.
(4) Accepted format: HTML, WORD, or PDF.
(5) Requirement to receive full points: Please present both code and code output for each
question.

< Tips >

If you have multiple files, you may put them in a zip file.
You may also save each file as PDF, go to https://www.adobe.com/acrobat/online/merge-
pdf.htmlLinks to an external site., upload your files there, merge them into 1 PDF file, and
then download the merged file.

< Sample code >

~~~ PART 2: CODE ~~~

https://www.adobe.com/acrobat/online/merge-pdf.htmlLinks

Note: Please double check your code file before you upload it. For example, you may
copy/paste the file on desktop, and make sure you’ve uploaded the correct one. After you
upload the file, download it and make sure it’s the correct one.