Statistical Hypothesis Testing: Constructing Test Statistics for Intermediate Econometrics, Study notes of Econometrics and Mathematical Economics

An overview of statistical hypothesis testing, focusing on constructing test statistics for intermediate econometrics. It covers testing a random variable that can take on two values, testing a hypothesis about a probability, and the importance of considering the type i and ii errors. The document also discusses testing linear and nonlinear hypotheses using the standard normal distribution and the chi-square distribution.

Typology: Study notes

Pre 2010

Uploaded on 03/18/2009

koofers-user-93g
koofers-user-93g 🇺🇸

10 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Notes For Intermediate Econometrics - 5
Paul L. Fackler - North Carolina State University
April 6, 2001
Constructing Test Statistics
Suppose we are interested in a random variable,
X
that can take on one of two values, 0 or 1 and
that a 1isrealized with probability
p
:
X
=
(
1 with prob.
p
0 with prob. 1
p
We are interested in whether
p
equals some specied constant, say
c
:
H
0
:
p
=
c
vs.
H
0
:
p
6
=
c
To test this hyp othesis we collect a sample of
n
observations that webelieve represent indepen-
dent draws from this a distribution of the form above. A test statistic is function of these sample
observations,
S
=
f
(
x
1
;x
2
; :::; x
n
), that, hopefully,willshedlightonthe hypothesis of interest.
The way we will proceed is to determine the probability of getting any particular value of
S
,
given that the null hyp othesis is true. If we nd that
S
is far from what we expect it to be under
the null hypothesis, we will conclude that the null hypothesis is, in fact, false.
A natural test statistic is to use the sample mean
S
=
P
i
x
i
=n
,which has expectation
p
. In this
case the probabilityunderthe null is extremely simple, at least for small
n
.
n
=1
S
=
(
1 with prob.
c
1
=
2
0 with prob. 1
c
1
=
2
n
=2
S
=
8
>
<
>
:
1 with prob.
c
2
1
=
4
1
=
2 with prob. 2
c
(1
c
) 1
=
2
0 with prob. (1
c
)
2
1
=
4
n
=3
S
=
8
>
>
>
<
>
>
>
:
1 with prob.
c
3
1
=
8
2
=
3 with prob. 3
c
2
(1
c
) 3
=
8
1
=
3 with prob. 3
c
(1
c
)
2
3
=
8
0 with prob. (1
c
)
3
1
=
8
The rightcolumnprovides the probabilities when
c
=1
=
2.
1
pf3
pf4
pf5

Partial preview of the text

Download Statistical Hypothesis Testing: Constructing Test Statistics for Intermediate Econometrics and more Study notes Econometrics and Mathematical Economics in PDF only on Docsity!

Notes For Intermediate Econometrics - 5

Paul L. Fackler - North Carolina State University

April 6, 2001

Constructing Test Statistics

Supp ose we are interested in a random variable, X that can take on one of two values, 0 or 1 and that a 1 is realized with probability p:

X =

1 with prob. p

0 with prob. 1 p

We are interested in whether p equals some sp eci ed constant, say c:

H 0 : p = c vs.

H 0 : p 6 = c

To test this hyp othesis we collect a sample of n observations that we b elieve represent indep en- dent draws from this a distribution of the form ab ove. A test statistic is function of these sample observations, S = f (x 1 ; x 2 ; :::; xn ), that, hop efully, will shed light on the hyp othesis of interest. The way we will pro ceed is to determine the probability of getting any particular value of S , given that the null hyp othesis is true. If we nd that S is far from what we exp ect it to b e under the null hyp othesis, we will conclude that the null hyp othesis is, in fact, false. A natural test statistic is to use the sample mean S =

P

i xi^ =n,^ which^ has^ exp^ ectation^ p.^ In^ this case the probability under the null is extremely simple, at least for small n.

n = 1 S =

1 with prob. c 1 = 2

0 with prob. 1 c 1 = 2

n = 2 S =

1 with prob. c^2 1 = 4

1 = 2 with prob. 2 c(1 c) 1 = 2

0 with prob. (1 c)^2 1 = 4

n = 3 S =

1 with prob. c^3 1 = 8

2 = 3 with prob. 3 c^2 (1 c) 3 = 8

1 = 3 with prob. 3 c(1 c)^2 3 = 8

0 with prob. (1 c)^3 1 = 8

The right column provides the probabilities when c = 1 =2.

Extreme values of S , ones near either 0 or 1, are unlikely under the null hyp othesis. A sensible test pro cedure is thus to cho ose an S and an S such that Prob[S 2 [S ; S ])  1 , for some sp eci ed value of (often 0.05). This ensures that there is only a small chance ( ) that S is outside of [S ; S ] when the null is true.^1 The value is called the critical value or the size of the test. For example, supp ose we have a sample of 3 observations and want to test whether c = 1 =2. If we set S = 1 = 3 and S = 2 =3, our critical value is 1/4, rather large. This means that we will falsely reject the null hyp othesis 1/4 of the time. In other words, if we get S = 0 or S = 1 we reject the null hyp othesis, but we will do this incorrectly 1/4 of the time that it is actually true. It may b e the case that we don't care whether p < c, in which case the test of interest b ecomes

H 0 : p  c vs. H 0 : p > c

In this case, with n = 3, we could set S = 0 and S = 2 =3. We would reject the null hyp othesis if S = 1 and the critical level would b e 1/8. Such a test is called a 1-tailed test as opp osed to the previous 2-tailed test. It is imp ortant to b e clear what the critical value actually represents. It is not the probability that the null is false. It is the conditional probability that we reject the null when it is true. These are very di erent, but often confused concepts. It is also imp ortant to consider the probability that we accept an incorrect hyp othesis or what is known as a typ e I I error, as opp osed to the typ e I error of rejecting a correct hyp othesis.

H 0 False True Reject  Typ e I error Don't Reject Typ e I I error 

The choice of the critical level should hinge on the relative cost of making a typ e I versus a typ e I I error. For example, supp ose you get an AIDs test. If the test is p ositive, you may require exp ensive further tests, have to answer p otentially embarrassing questions and have your sexual partners contacted. If the test is a false negative, however, you may not receive immediate and p otentially life saving treatment.

Tests Concerning Parameter Values

Most of the estimators that we have discussed have asymptotic distributions that are normally distributed:

^  N ( ; ( )): (^1) Generally one attempts to make the probability rejection from to o low a value ab out the same as the probability

of rejection from to o high a value.

Finally, what if we are interested in a nonlinear hyp othesis, such as R ( ) = 0. It is not true the joint normality of ^ implies that R ( ^ ) is normally distributed. Let us consider a Taylor expansion of R ( ^ ) evaluated at the true  :

R ( ^ ) = R ( ) + R 0 ( )( ^  ) + 2nd order term:

Asymptotically, the 2nd order term go es to 0 relatively quickly. Furthermore, under the null hyp othesis, R ( ) is 0, so (asymptotically)

R ( ^ )  N (0; R 0 ( )R 0 ( )>^ ):

Thus

T =

R ( ^ )

q

R 0 ( )R ( )>

 N (0; 1):

so if T is outside the interval [ 1 : 96 ; 1 :96] we should reject the null hyp othesis (at the 5% level of

signi cance). In practice, of course, we use

T =

R ( ^ )

q

R 0 ( ^ )R 0 ^ )>

(i.e., use the estimator ^ in computing R 0 ( )). All of the earlier examples are sp ecial cases of this one, so we really only need one test statistic to test arbitrary restrictions on parameters for which we have an asymptotically unbiased and normally distributed estimator (and we know its covariance). The test statistic T is (asymptotically) standard normal. This implies that

T 2 =

R ( ^ )^2

R 0 ( )R ( )>^

 ^21 :

We reject the test statistic when it is larger than 3 : 8415 = 1 : 962 , which is the 95th p ercentile of the ^21 distribution. Thus, we can either use the standard normal distribution with T or the ^21 distribution with T 2. This would b e little more than an interesting fact except that it provides a way to test multiple hyp otheses simultaneously. Supp ose that we want to test R ( ) = 0 where R is a vector valued function. For example supp ose that we want to test that all of the elements of  are equal to 0; i.e., that R ( ) = . In general, if R ( ) is an m-vector (with m no greater than the size of  ), under the null hyp othesis, R ( ^ ) is asymptotically N (0; R 0 ( ) )R 0 ( )>^ ). This implies that

T 2 = R ( ^ )>

h

R 0 ( )R 0 ( )>

i 1

R ( ^ )  ^2 m :

If T 2 is to o big, we reject the null hyp othesis; for a signi cance level of 0 : 05 we need to know the 95th p ercentile of the ^2 m distribution. This can b e found in statistical tables or in Matlab (with

the statistics to olb ox) you can get this with chi2inv(.95,m). The values for m from 1 to 5 are listed b elow.

m 1 2 3 4 5 95th p ercentile of ^2 m 3 : 8415 5 : 9915 7 : 8147 9 : 4877 11 : 0705

In summary, we now have a very general way to test single or joint hyp otheses ab out parameters that we have estimated. Whether we used metho d of moments, maximum likeliho o d or least squares, we get an estimator that is normally distributed asymptotically and we can test arbitrary functions of the parameters, R ( ) = 0 by computing

T 2 = R ( ^ )>

h

R 0 ( )R 0 ( )>

i 1

R ( ^ )

and seeing if it is bigger than the p ercentile of the ^2 m distribution (where m is the numb er of individual hyp otheses b eing tested). If T 2 is bigger, then we say that we can reject the null hyp othesis at the signi cance level.

Example: TraÆc Tickets and Accidents

Supp ose that we have observations on a set of n individuals on whether the individual has had a traÆc ticket in the last three years and also on whether they have had an accident in that same p erio d.

Xi =

1 if individual i has had a traÆc ticket in the last three years 0 otherwise

Yi =

1 if individual i has had a traÆc accident in the last three years 0 otherwise

For any individual, there are four p ossible values of the pair (X ; Y ):

(X ; Y ) = f(0; 0); (0; 1); (1; 0); (1; 1)g:

We can express the asso ciated probabilities in terms of the parameters p, q and r : X 0 1 0 1+r-p-q p-r 1-q Y 1 q-r r q 1-p p 1 The parameters have natural interpretations:

Prob[X = 1] = E[X ] = p Prob[Y = 1] = E [Y ] = q Prob [X Y = 1] = E[X Y ] = r:

If X and Y are indep endent then r = E [X Y ] = E[X ]E [Y ] = pq. How can we test this hyp othesis?

Thus our test statistic is^2

T 2 =

n( p^ q^ ^r )^2

p ^ q^ (1 p^)(1 q^ )

If this is bigger than 3.8415 we should reject the null hyp othesis at the 0 : 05 signi cance level. Let us make this concrete with an example. Supp ose in a sample of size 500, we have s 00 = 87, s 01 = 152, s 00 = 107, and s 11 = 154. The metho d of moments estimator is p^ = 0 :5220, q^ = 0 : 6120 and ^r = :3080. The rst test (that p = q ) has test statistic of approximately 7.943 (7.819 if we use the simpler expression for the variance), indicating that the null hyp othesis should b e rejected at the 5% level (the p-value asso ciated with the test is 0.0048, indicated that it could b e rejected at the 1/2% signi cant level as well). The test that pq = r (indep endence) is 1.109, so this hyp othesis should not b e rejected at the 5% level (its p-value is ab out 29%). Let's nish this example with a joint test that p = 1 = 2 and q = 1 =2. In this case

R 0 ( ) =

This leads to the test statistic

T 2 = n

p^ 1 = 2

q^ 1 = 2

p^(1 p^) ^r p^ ^q

^r p^ ^q q^ (1 ^q )

p^ 1 = 2

q^ 1 = 2

for our numerical example, this leads to a test statistic value of 27.92. This test statistic is asymp- totically ^22 , for which the 95th p ercentile is 5.99; hence the hyp othesis should b e rejected.

(^2) You may b e familiar with the so-called chi-squared test for indep endence for categorical data which is describ ed

in most basic statistics textb o oks (see p. 149 of Kmenta). The metho d-of-moments based test that pq = r is exactly the same test.