You are on page 1of 33

Basic Regression Analysis: Hypothesis Testing and

Model Speciifcation

Yiran Xie

School of Economics, University of Sydney

August 17, 2022

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 1 / 32
Table of contents

1. Hypothesis Testing
Hypothesis test of single restriction: Review
Hypothesis test of multiple linear restrictions

2. Model Specification

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 2 / 32
Reference:
Chapter 7.2.1 and 4.7.4, Microecononmetrics: Methods and Applications,
Cameron and Trivedi (2005)
Chapter 3.4, Microecononmetrics Using Stata, Cameron and Trivedi (2009)

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 3 / 32
Hypothesis Testing

Hypothesis testing: Wald test

Consider test of a single restriction

H0 :β = β0
∕ β0
H1 :β =

A Wald test rejects H0 if β̂ differs greatly from β0 .


It is the commonly-used method to test H0 against H1

Post-estimation Wald test with β0 = 0:


a way to find out if explanatory variables in a model are significant.
”Significant” means that they add something to the model; variables that add
nothing can be deleted without affecting the model in any meaningful way.

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 4 / 32
Hypothesis Testing Hypothesis test of single restriction: Review

Hypothesis test of single restriction: Review

Suppose we want to test if our estimated β̂j (the coefficient of the j-th
regressor) is significantly different from a constant β0
Define σβ̂ to be the asymptotic standard deviation of β̂j . Then
a
β̂j ∼ N [β, σβ̂2 ] for unknown β
β̂j − β a
⇒ ∼ N [0, 1] standardizing
σβ̂
β̂j − β0 a
⇒ zj = ∼ N [0, 1] under H0 : β = β0
σβ̂

When β0 = 0, this test tells if the j-th regressor is significant

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 5 / 32
Hypothesis Testing Hypothesis test of single restriction: Review

To implement this test, replace σβ̂ by sβ̂ , the standard error of β̂.
Because we do not know the true value of σβ̂
This makes no difference asymptotically (so still N [0, 1] if N is large; when N
is small, use t-distribution instead).
Test statistic: Wald z-statistic

β̂j − β0 a
zj = ∼ N [0, 1] under H0 : β = β0
sβ̂

Implementation by two equivalent methods


Test using p-values: reject H0 at level 0.05 if

p = Pr [|Z | > |zj |] < 0.05, where Z ∼ N [0, 1]

Test using critical values: reject H0 at level 0.05 if

|zj | > z.025 = 1.96

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 6 / 32
Hypothesis Testing Hypothesis test of single restriction: Review

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 7 / 32
Hypothesis Testing Hypothesis test of single restriction: Review

Hypothesis test of single restriction: t-distribution

Many packages such as Stata use T (N − K ) rather than N [0, 1]


More conservative (less likely to reject H0 )
Exact in unlikely special case that ui ∼ N[0, σ 2 ].
Better finite sample approximation

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 8 / 32
Hypothesis Testing Hypothesis test of single restriction: Review

Confidence interval

A 100(1 − α)% confidence interval for β is

β̂ ± zα/2 × sβ̂

in particular a 95% confidence interval is β̂ ± 1.96sβ̂ .


can replace zα/2 by Tα/2 (N − K ) for better finite sample performance

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 9 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Joint Hypothesis?

Question: What is the difference between a Joint Hypothesis Testing and the
standard Single Hypothesis Testing?
Answer: Joint Hypothesis tests multiple conjectures
Joint Hypothesis contains multiple equal signs
Model Y = β0 + β1 x1 + β2 x2 + u
Examples of Single Hypothesis Testing

H0 : β1 = 0 versus H1 : β1 ∕= 0
H0 : β1 − β2 = 3 versus H1 : β1 − β2 ∕= 3

Examples of Joint Hypothesis Testing

H0 : β1 = 0 and β2 = 0 versus H1 : β1 ∕= 0 and/or β2 ∕= 0


H0 : β1 = β2 and β0 = 0 versus H1 : β1 ∕= β2 and/or β0 ∕= 0

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 10 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Why Study Joint Hypothesis Testing?

Question: Does the quantity demanded of a product A depend on the prices


of substitute goods B, C (or only on its own price PriceA )?

DemandA = β0 + β1 PriceA + β2 PriceB + β3 PriceC + u

We seek to test the hypothesis whether the set of explanatory variables


PriceB , PriceC jointly cause the dependent variable DemandA .
Null Hypothesis: the coefficients of PriceB , PriceC are jointly equal to zero

H0 : β2 = 0 and β3 = 0

Alternative Hypothesis: at least one of the regression coefficients differs from


zero
H1 : β2 ∕= 0 and/or β3 ∕= 0

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 11 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Hypothesis test of multiple linear restrictions


Consider test of several linear restrictions
e.g. Test H0 : β1 = 0, β2 = 0 against H1 : at least one ∕= 0.
In matrix algebra we test

H0 : Rβ = r against H1 : Rβ ∕= r

Example: Linear model y = X β + u


or yi = β0 + β1 x1i + β2 x2i + ... + βK xKi + ui for i = 1, ..., N.
Test H0 : β1 = 0, β2 = 0 against H1 : at least one ∕= 0.
We can rewrite H0 using matrix notations:
# &
β0
! " ! " $ β1 '
$
' ! "
β1 0 1 0 · · · 0 $ β2 ' 0
= $ '=
β2 0 0 1 ··· 0 $ . ' 0
% .. (
βK

or Rβ = r .
Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 12 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Quick practice:
yi = β0 + β1 x1i + β2 x2i + ... + βK xKi + ui for i = 1, ..., N
Test H0 : β0 = 0, 2β1 + 3β2 = 1 against H1 : β0 ∕= 0 or 2β1 + 3β2 ∕= 1
What are R and r ?

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 13 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Quick practice:
yi = β0 + β1 x1i + β2 x2i + ... + βK xKi + ui for i = 1, ..., N
Test H0 : β0 = 0, 2β1 + 3β2 = 1 against H1 : β0 ∕= 0 or 2β1 + 3β2 ∕= 1
What are R and r ?
Answers.
! "
1 0 0 0 ··· 0
R=
0 2 3 0 ··· 0
! "
0
r=
1

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 13 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

A Wald test rejects H0 : Rβ = r if R β̂ − r differs greatly from 0.


Now R β̂ − r is normal as linear combination of normals is normal
a
β̂ ∼ N [β, V [β̂]] for unknown β
a ′
⇒ R β̂ − r ∼ N [Rβ − r , RV [β̂]R ] linear transformation
a
⇒ R β̂ − r ∼ N [0, RV [β̂]R ′ ] under H0 : Rβ = r
′ −1/2 a
⇒ [RV [β̂]R ] (R β̂ − r ) ∼ N [0, Ih ] standardizing

where h is the number of restrictions.


a
⇒ (R β̂ − r )′ [RV [β̂]R ′ ]−1 (R β̂ − r ) ∼ χ2 (h) under H0

The last step converts to chi-square using the result

z ∼ N [0, IN ] ⇒ z ′ z ∼ χ2 (N)

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 14 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

To implement this test, replace V [β̂] by V̂ [β̂]


This makes no difference asymptotically.
Test statistic: Wald chi-squared statistic
a
W = (R β̂ − r )′ [R V̂ [β̂]R ′ ]−1 (R β̂ − r ) ∼ χ2 (h) under H0

Implementation by two equivalent methods


Test using p-values: reject H0 at level 0.05 if

p = Pr [χ2 (h) > W ] < 0.05.

Test using critical-values: reject H0 at level 0.05 if

W > χ2.05 (h)

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 15 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 16 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

The alternative Wald F-test statistic is


W
F = ∼ F (h, N − K ) under H0
h

Makes no difference asymptotically as F (h, N) → χ2 (h)/h as N → ∞.


More conservative (less likely to reject H0 )
Exact in unlikely special case that ui ∼ N [0, σ 2 ].
Better finite sample approximation

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 17 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Quick practice (Continued):


yi = β0 + β1 x1i + β2 x2i + ... + βK xKi + ui for i = 1, ..., N
Test H0 : β0 = 0, 2β1 + 3β2 = 1 against H1 : β0 ∕= 0 or 2β1 + 3β2 ∕= 1
Suppose β̂0 = 1, β̂1 = 1, β̂2 = −0.3,
)# & + # & # &
β̂0 V [β̂0 ] Cov [β̂0 , β̂1 ] Cov [β̂0 , β̂2 ] 1 0 0
V *%β̂1 (, = %Cov [β̂1 , β̂0 ] V [β̂1 ] Cov [β̂1 , β̂2 ]( = %0 1 0.5(
β̂2 Cov [β̂2 , β̂0 ] Cov [β̂2 , β̂1 ] V [β̂2 ] 0 0.5 1

What is the Wald chi-squared statistic?

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 18 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 19 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Quick practice (Continued):


yi = β0 + β1 x1i + β2 x2i + ... + βK xKi + ui for i = 1, ..., N
Test H0 : β0 = 0, 2β1 + 3β2 = 1 against H1 : β0 ∕= 0 or 2β1 + 3β2 ∕= 1
Suppose β̂0 = 1, β̂1 = 1, β̂2 = −0.3,
)# & + # & # &
β̂0 V [β̂0 ] Cov [β̂0 , β̂1 ] Cov [β̂0 , β̂2 ] 1 0 0
V *%β̂1 (, = %Cov [β̂1 , β̂0 ] V [β̂1 ] Cov [β̂1 , β̂2 ]( = %0 1 0.5(
β̂2 Cov [β̂2 , β̂0 ] Cov [β̂2 , β̂1 ] V [β̂2 ] 0 0.5 1

What is the Wald chi-squared statistic?


Solutions.

W = (R β̂ − r )′ [R V̂ [β̂]R ′ ]−1 (R β̂ − r )
! "! "
- . 1 0 1
= 1 0.1 = 1.19
0 19 0.1
a
Since W ∼ χ2 (2) under H0 and W < χ20.05 (2) = 5.991, we cannot reject the null
hypothesis.

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 20 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

χ2 distribution table

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 21 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Stata code for finding p-values and critical values

How do I have Stata report normal tail areas and inverse normal tail
areas?
To compute the left tail area for a given z value, use
display normal(z)
where z is the value of interest.
To compute the inverse tail area for an area equal to p, use
display invnormal(p)

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 22 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Stata code for finding p-values and critical values

How do I use Stata to calculate tail areas and critical values for the t
distribution?
ttail(df,t): df is degrees of freedom and t is the test statistic.
display ttail(5,2) will return the upper tail area (to the right of 2) of a t
distribution with 5 degrees of freedom.
invttail(df,p): p is a right tail area from a t distribution with df degrees
of freedom.
display invttail(5,.05) will return the critical value from a t distribution
with 5 degrees of freedom such that the area to the right of the value is 0.05
Other distributions: chi2tail(df, c), invchi2tail(df, p),
Ftail(df1 ,df2 ,F), invFtail(df1 ,df2 ,p)

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 23 / 32
Hypothesis Testing Hypothesis test of multiple linear restrictions

Stata example

In Week 1, we ran regressions using a medical expenditure dataset.


We can performed hypothesis test using Stata command test.

H0 :βprivate = 0, βchronic = 0
H1 : at least one of βprivate ∕= 0, βchronic ∕= 0

Stata post-estimation command test yields


. ∗ Wald t e s t o f r e s t r i c t i o n s
. q u i e t l y r e g r e s s d o c v i s p r i v a t e c h r o n i c f e m a l e income , v c e ( r o b u s t )

. t e s t ( p r i v a t e = 0) ( c h r o n i c = 0)

( 1) p r i v a t e = 0
( 2) c h r o n i c = 0

F (2 , 4407) = 165.11
Prob > F = 0 . 0 0 0 0

Reject H0 at level 0.05 since p < 0.05


or 165.11 > F.05 (2, 4407) = 3.00 using invFtail(2,4407,.05)
Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 24 / 32
Model Specification

Model Specification in Multiple Regression Model

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 25 / 32
Model Specification

Questions Regarding Model Specification

First step of any econometric investigation is the choice of the model


Question: What are the considerations when choosing a model?
Answer: Use theory and economic rationale, think critically

Question: What are the consequences of choosing the wrong model?


Answer: Estimates are likely to be biased and misleading

Question: What constitute a wrong model?


Answer: Bad functional form or omission of important explanatory variables

Question: What happens when we omit important explanatory variables?


Answer: Generate Omitted Variable Bias

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 26 / 32
Model Specification

Omitted Variable Estimation

The dataset used is ”edu inc” from R package ”PoEdata”


Correct Model: FAMINC = β1 + β2 HEDUC + β3 WEDUC + e
FAMINC = Family income
HEDUC = Husband’s education
WEDUC = Wife’s education
Correct Estimation is given by:

! = −5, 534 + 3, 132HEDU + 4, 523WEDU


FAMINC
(se) (11,230) (803) (1,066)

Incorrect Estimation, we incorrectly omit wife’s education::

! = −26, 191 + 5, 155HEDU


FAMINC
(se) (8,541) (658)

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 27 / 32
Model Specification

! = −5, 534 + 3, 132HEDU + 4, 523WEDU


FAMINC
(se) (11,230) (803) (1,066)

! = −26, 191 + 5, 155HEDU


FAMINC
(se) (8,541) (658)

Omission of a relevant variable leads to a biased estimator


Omitted-variable bias induced by omitting a relevant variable

Question: What is the main consequence?


Answer: Misleading Interpretation
Omitting WEDU leads us to overstate the effect of an extra year of
education for the husband by about $2,000 !!!
The marginal effect of schooling for the husband is $3,000, not $5,000.
Omitted variable inflates the marginal effect by almost 70%

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 28 / 32
Model Specification

Formula for Omitted variable bias

Correct model is given by: yi = xi′ β + zi α + vi


(xi′ and zi are regressors, zi is a scalar for simplicity, vi is independent of xi′
and zi )

Correct regression yi = xi′ β̂ + zi α̂ + ei


Omitted Variable regression yi = xi′ β̂ ∗ + ei∗

Omitting zi is equivalent to imposing the restriction α = 0.


The estimator β̂ ∗ is biased. But what is the formula for the bias?

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 29 / 32
Model Specification

Formula for Omitted variable bias

Stacking all observations yi = xi′ β + zi α + vi gives the d.g.p.

y = X β + zα + v

When z is omitted, the estimated model is

y = X β + (zα + v )

The biased OLS estimator β̂ ∗ = (X ′ X )−1 X ′ y . Substitute y with the model


yields

β̂ ∗ = (X ′ X )−1 X ′ (X β + zα + v )
= β + (X ′ X )−1 X ′ zα + (X ′ X )−1 X ′ v
= β + (N −1 X ′ X )−1 (N −1 X ′ z)α + (N −1 X ′ X )−1 (N −1 X ′ v )

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 30 / 32
Model Specification

Formula for Omitted variable bias

N −1 X ′ X converge in probability to some finite and invertible matrix


! p
N −1 X ′ X = N1 i xi xi′ → E [xi xi′ ]
(the first equality comes from X = [x1 , x2 , ..., xN ]′ , xi is a K × 1 column vector)

N −1 X ′ v converge in probability to 0
! p
N −1 X ′ v = 1
N i xi vi → E [xi vi ] = 0 because xi and vi are independent
/ p
N −1 X ′ z = 1
N i xi zi → E [xi zi ] it is not 0 if xi and zi are correlated

⇒ plim β̂ ∗ = β + δα

where

δ = plim[(N −1 X ′ X )−1 (N −1 X ′ z)] = E [xi xi′ ]−1 E [xi zi′ ]

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 31 / 32
Model Specification

Understanding the Omitted variable bias

The Omitted Variable Bias is given by:

bias(β̂ ∗ ) = E (β̂ ∗ ) − β = E [xi xi′ ]−1 E [xi zi′ ] · α = δα

Main Properties
The sign of the bias depends two factors: α and δ
α > 0 because wife’s education has a positive effect on family income
δ = Cov (HEDU, WEDU)/Var (HEDU) > 0 because husband/wife education is
positively correlated
(Assortative Matching: couples often have similar schooling levels)
We conclude that the bias is positive
If correlation/covariance were 0: Cov (xi , zi ) = 0 No Bias!

Yiran Xie (School of Economics, University of Sydney) Basic Regression Analysis August 17, 2022 32 / 32

You might also like