You are on page 1of 13

Econ 123A: Midterm (10/25/2016)

In-Class
Matt Harding

Instructions
PLEASE READ CAREFULLY before starting.

Write your name here: ...........................................


Write your id number here:...........................................
Write down the row you are currently sitting in: ...........................................
(count from the front of the class)
Write down the seat in the row you are currently sitting in: ...........................................
(count from left to right along the row you are in)
This test has a total of 100 points and has a total of 3 questions. Questions 1 and
2 have 32 points each. Question 3 has 36 points. The weight on each subquestion is
roughly equal.
You are allowed one letter-sized page of notes (single-sided) but it is otherwise a
closed-book exam. You are not allowed to use laptops, smart phones or iPads.
You are allowed to use a calculator.
Show your work! No credit will be given for correct answers if you do not justify
your argument.
Please make sure that your handwriting is legible!
In essay questions, be precise but brief. If a correct reply is hidden among wrong,
or irrelevant, arguments, you will not get full credit.
We will grade only what is written on this test. There should be plenty of space for
all your calculations.
If time is running short, set up the problem without final calculations.
If you cannot solve one subquestion do not skip the rest of the question. Attempt to
solve each subquestion.

Please do not turn this page over until you are instructed
to do so!
This page is empty. Use for intermediate calculations. It will not be graded.
1 (32 points)
Consider the simple linear regression model,

yi = 1 + 2 x i + ui

(a) Name and briefly discuss (3) three assumption of the Gauss-Markov Theorem in rela-
tion to the above model.

We proved in class that the OLS estimators for 1 and 2 are given by:
PN
i=1 (xi x)(yi y)
b2 = PN
i=1 (xi x)
2

b1 = y b2 x
In the following parts of the question, you can take these expressions as given and do not
need to re-derive them.

(b) Show that


PN
i=1 (xi
1
x)ui
b2 = 2 + N
PN .
i=1 (xi
1
N x)2

What assumption about ui guarantees that b2 is an unbiased estimator?

1
(c) Define ybi and u
bi . Show that
N
1 X
bi = 0
u
N i=1
N
1 X
ybi = y
N i=1

2
(d) If R2 = 1, show mathematically the condition that ui must satisfy for all i?

3
2 (32 points)
Professor Freud wants to model the market for cocaine powder in Austria. He collects the
following variables: Price (price per gram in dollars for a cocaine sale), Quant (number
of grams of cocaine in a given sale), Qual (quality of the cocaine expressed as percentage
purity) and Trend (a time variable denoting the year in which a given sale was conducted;
the first year in the sample is denoted by 1, the second by 2 etc.). Professor Freud thinks
that the true model for the price of cocaine is given by:

Pricei = 1 + 2 Quanti + 3 Quali + 4 Trendi + i

(a) If Professor Freud is correct and the true model is as given above, what signs would
you expect for the coefficients 2 , 3 , and 4 and why?

Professor Freud uses data on a total of N = 560 different sales over a 5 year period and
obtains the following regression estimates:

Pd
ricei = 90.85 0.06 Quanti + 0.12 Quali 2.35 Trendi
(8.58) (0.01) (0.20) (1.39)
R2 = 0.51

(b) Test the hypothesis that the quality of cocaine has no influence on the price at the
5% significance level. Formulate the hypothesis, specify the test statistic, state the
rejection region and your conclusion.

4
(c) Explain how you would use the F-test to test the hypothesis that 2 = 23 . (You
dont have to do the test, just write down the steps to do it.)

Table 1: Percentiles of the t-distribution


df t0.95,df t0.975,df t0.99,df t0.995,df
1.645 1.96 2.326 2.576

(d) Do you think that Professor Freuds model suffers from omitted variables bias? Ex-
plain.

5
3 (36 points)
We are interested in the following regression model:

ln(wagei ) = 0 + 1 experi + 2 educi + 3 educ2i + i


There are two parts to each subquestion. The first part will test your Stata program-
ming knowledge. One or two lines of code have been blanked out in the .do file for each
corresponding subquestion. Complete the lines of missing code. Be sure to write the
entire line of code (ignoring the comments in gray). Dont just fill in the blanks. Proper
Stata syntax matters.
The second part will test your ability to read and interpret Stata output. Refer to the
output file for tables and statistics. It contains everything you need to answer the question.

(a) We first describe the data (see output file). Next, we want to generate a new variable
for the log of variable wage.

(i) Complete line 11 of the .do file, which generates a new variable lnwage.
(ii) What does f emale = 0 indicate about an individual?

(b) We want to estimate the regression coefficients for a subsample of the data by OLS.
The subsample we are interested is males.

(i) Complete line 18 of the .do file, which estimates the regression coefficients using
the male subsample of our data.
(ii) Interpret the coefficient estimate of variable exper.

6
(c) We want to know the covariance of our coefficient estimates.

(i) Complete line 24, which generates the variance/covariance matrix of the coeffi-
cient estimates.
(ii) Find the variance of marginal effect ln(wage)
educ at educ = 20. That is, find. . .
 
ln(wage)
V ar
educ educ=20

7
(d) We want to save the residuals of our regression to variable ehat and then check to see
if they are normally distributed.
(i) Complete lines 29 and 32, which save the residuals of the male subsample to
variable ehat and create a histogram of residuals ehat overlaid by a normal pdf
line.
(ii) What is the conclusion of the Jarque-Bera test? Provide specific evidence from
the output file that supports your conclusion.

8
Question 3 .do file
1 * Q3
2
3 use cps4 small.dta, clear
4 keep wage educ exper female
5
6
7 * (a)
8
9 describe /* describe the variables in the data */
10
11 lnwage /* generate variable lnwage (log of wage) */
12
13
14 * (b)
15
16 gen educ2 = educ2/* generate educ squared */
17
18 /* regress lnwage ver-
19 sus selected covariates on the male subsample */
20
21
22 * (c)
23
24 /* list the variance/covariance matrix of the coefficient estimates */
25
26
27 * (d)
28
29 ehat , /* save the residuals to ehat
30 for male subsample*/
31
32 ehat, /* create histogram of the residuals. overlay
33 with normal pdf.*/
34
35 sktest ehat /* run the JB (Jarque-Bera) test for normality */

You might also like