You are on page 1of 28

1/28

EC114 Introduction to Quantitative Economics


8. Hypothesis Testing II
Department of Economics
University of Essex
29 November/1 December 2011
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
2/28
Outline
1
Introduction
2
Small Samples and Students t-distribution
3
Testing Hypotheses About Population Variances
4
p-values
5
More on the t and
2
Distributions
Reference: R. L. Thomas, Using Statistics in Economics,
McGraw-Hill, 2005, sections 5.1, 5.2, 5.4 and Appendix 5A.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Introduction 3/28
We have looked at hypothesis tests concerning the
population mean, .
With a random sample and a large sample size n our tests
have been motivated by the Central Limit Theorem.
Here, we want to:
address what happens in small samples;
test hypotheses about the population variance,
2
, as well
as ;
consider the use of p-values.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 4/28
For large sample size n the Central Limit Theorem has
enabled us to base tests about on the standard normal
variable
Z =

X
/

n
N(0, 1),
where

X denotes the sample mean. Note that:
this distribution holds under the null hypothesis H
0
;
the statistic assumes that is known.
Even if is unknown, we can replace
2
by the unbiased
estimator s
2
(the sample variance).
For large n we can still use Z with replaced by s, and the
approximation is better the larger is n.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 5/28
But in small samples, replacing by s does affect the
distribution it is no longer N(0, 1).
If is known, then even for small n,
Z =

X
/

n
N(0, 1),
provided that X is normally distributed.
However, if we replace by s, provided that X is normally
distributed, then

X
s/

n
t
n1
,
where t
n1
denotes the Students t-distribution with n 1
degrees of freedom.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 6/28
The t-distribution reects the fact that, in repeated
samples, it is not only the value of

X that will change, but
also the value of s.
The result is that the N(0, 1) no longer describes this
distribution.
Why is the distribution called Students t?
It was discovered by William Sealy Gosset (18761937)
writing under the pseudonym Student in 1908 in the
journal Biometrika.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 7/28

This is WS Gosset in 1908.
But what does the t-distribution look like?
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 8/28

The t-distribution has a similar shape to the N(0, 1), but
has fatter tails.
This is due to the uncertainty associated with estimating
2
by s
2
.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 9/28

As n gets larger, t
n1
gets closer to the N(0, 1).
Areas beneath the t-distribution represent probabilities.
Table A.2 of Thomas gives critical values for the
t-distribution.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 10/28
Percentage points of Students t-distribution with v degrees
of freedom
v 0.25 0.10 0.05 0.025 0.01 0.005
1 1.000 3.078 6.314 12.706 31.821 63.657
2 0.816 1.886 2.920 4.303 6.965 9.925
3 0.765 1.638 2.353 3.182 4.541 5.841
4 0.741 1.533 2.132 2.776 3.747 4.604
5 0.727 1.476 2.015 2.571 3.365 4.032
6 0.718 1.440 1.943 2.447 3.143 3.707
7 0.711 1.415 1.895 2.365 2.998 3.499
8 0.706 1.397 1.860 2.306 2.896 3.355
9 0.703 1.383 1.833 2.262 2.821 3.250
10 0.700 1.372 1.812 2.228 2.764 3.169
11 0.697 1.363 1.796 2.201 2.718 3.106
12 0.695 1.356 1.782 2.179 2.681 3.055
13 0.694 1.350 1.771 2.160 2.650 3.012
14 0.692 1.345 1.761 2.145 2.624 2.977
15 0.691 1.341 1.753 2.131 2.602 2.947
16 0.690 1.337 1.746 2.120 2.583 2.921
17 0.689 1.333 1.740 2.110 2.567 2.898
18 0.688 1.330 1.734 2.101 2.552 2.878
19 0.688 1.328 1.729 2.093 2.539 2.861
20 0.687 1.325 1.725 2.086 2.528 2.845
25 0.684 1.316 1.708 2.060 2.485 2.787
30 0.683 1.310 1.697 2.042 2.457 2.750
40 0.681 1.303 1.684 2.021 2.423 2.704
60 0.679 1.296 1.671 2.000 2.390 2.660
100 0.677 1.290 1.660 1.984 2.364 2.626
0.674 1.282 1.645 1.960 2.326 2.576
Entries are t

such that Pr(t


v
> t

) = , e.g. Pr(t
5
> 2.571) = 0.025.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 11/28
What are the degrees of freedom (d.f.)?
As a general rule, the degrees of freedom are the sample
size (n) minus the number of estimated parameters.
Here the t-distribution has n 1 d.f. because has been
estimated using s.
This changes the N(0, 1) into the t
n1
distribution.
How is the t-distribution used in practice?
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 12/28
Example. The mean annual income in a large city is
claimed to exceed 18,000. To test this claim, a random
sample of 10 residents were interviewed and found to have
the following incomes:
19, 200 20, 300 18, 100 19, 700 16, 800
19, 600 15, 400 19, 900 20, 800 18, 200
Use these data to test the claim.
Solution. The null and alternative hypotheses are:
H
0
: = 18, 000, H
A
: > 18, 000;
hence we have an upper one-tail test. Under H
0
,
TS =

X 18, 000
s/

n
t
n1
.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 13/28
Solution (continued). We shall use a 5% signicance
level. We have n = 10 and so there are n 1 = 9 d.f.; from
the table we nd that the 5% critical value is 1.833. The
test criterion is therefore:
reject H
0
if TS > 1.833, but reserve judgement otherwise.
The data give

i
X
i
= 188, 000;

i
X
2
i
= 3, 559, 880, 000;

i
(X
i

X)
2
= 25, 480, 000.
Hence

X =

X
i
n
=
188, 000
10
= 18, 800.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 14/28
Solution (continued). There are two ways to calculate s
2
:
s
2
=

X
2
i
n 1

n
n 1

X
2
=
3, 559, 880, 000
9

10
9
(18, 800)
2
= 2, 831, 111,
or
s
2
=

i
(X
i

X)
2
n 1
=
25, 480, 000
9
= 2, 831, 111.
Either way, s =

2, 831, 111 = 1682.6 and so


TS =

X 18, 000
s/

n
=
18, 800 18, 000
1682.6/

10
= 1.50.
As TS = 1.50 < 1.833 we do not reject H
0
: = 18, 000.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 15/28
We can also construct condence intervals based on the
small-sample results using the t-distribution.
Again we replace with s and the critical value from N(0, 1)
with that from the t
n1
distribution.
A 95% condence interval for the population mean is

X t
0.025
s

n
,
where t
0.025
is the value that puts 2.5% of the t-distribution
into the upper tail (and hence 2.5% into the lower tail as
well).
Example (continued). Construct a 95% condence
interval for , the population mean income of residents in a
large city.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Small Samples and Students t-distribution 16/28

Solution (continued). The 2.5% critical value of the t
9
distribution is 2.262. Hence our 95% condence interval is

X 2.262
s

n
= 18, 800 2.262
1682.6

10
i.e. 18, 800 1203.6 or 17,596.4 to 20,003.6.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 17/28
Sometimes we may wish to test hypotheses about the
population variance,
2
.
We proceed in a similar way to tests concerning the
population mean, , but the distribution is no longer N(0, 1)
or t
n1
.
First, we need to dene the null and alternative
hypotheses:
e.g. H
0
:
2
= 10 (or some xed number)
vs. H
A
:
2
> 10 (upper one-tail test)
or H
A
:
2
< 10 (lower one-tail test)
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 18/28
We can base our test on the following result:
(n 1)s
2

2

2
n1
where
2
n1
denotes the chi-squared distribution with n 1
d.f.
Note that this result holds provided X is normally
distributed.
Also, because s
2
and
2
are both positive, the statistic itself
is also always positive.
What does the
2
distribution look like?
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 19/28

Note that it is dened for positive values.
Areas under the curve represent probabilities.
The expected value (mean) is:
E(
2
) = (n 1)
E(s
2
)

2
= (n 1)

2
= n 1.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 20/28

Our test procedure is similar to the z- and t-tests.
We need to nd a critical value; for an upper one-tail test at
the 5% level, we would want to nd the value that puts 5%
of the distribution into the upper tail (as in the diagram).
Table A.3 of Thomas contains the relevant information.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 21/28
Percentage points of
2
-distribution with v degrees of freedom
v 0.995 0.99 0.975 0.95 0.05 0.025 0.01 0.005
1 0.0000393 0.000157 0.000982 0.00393 3.841 5.024 6.635 7.879
2 0.0100 0.0201 0.0506 0.103 5.991 7.378 9.210 10.597
3 0.0717 0.115 0.216 0.352 7.815 9.348 11.345 12.838
4 0.207 0.297 0.484 0.711 9.488 11.143 13.277 14.860
5 0.412 0.554 0.831 1.145 11.070 12.833 15.086 16.750
6 0.676 0.872 1.237 1.635 12.592 14.449 16.812 18.548
7 0.989 1.239 1.690 2.167 14.067 16.013 18.475 20.278
8 1.344 1.646 2.180 2.733 15.507 17.535 20.090 21.955
9 1.735 2.088 2.700 3.325 16.919 19.023 21.666 23.589
10 2.156 2.558 3.247 3.940 18.307 20.483 23.209 25.188
11 2.603 3.053 3.816 4.575 19.675 21.920 24.725 26.757
12 3.074 3.571 4.404 5.226 21.026 23.337 26.217 28.300
13 3.565 4.107 5.009 5.892 22.362 24.736 27.688 29.819
14 4.075 4.660 5.629 6.571 23.685 26.119 29.141 31.319
15 4.601 5.229 6.262 7.261 24.996 27.488 30.578 32.801
16 5.142 5.812 6.908 7.962 26.296 28.845 32.000 34.267
17 5.697 6.408 7.564 8.672 27.587 30.191 33.409 35.718
18 6.265 7.015 8.231 9.390 28.869 31.526 34.805 37.156
19 6.844 7.633 8.907 10.117 30.144 32.852 36.191 38.582
20 7.434 8.260 9.591 10.851 31.410 34.170 37.566 39.997
21 8.034 8.897 10.283 11.591 32.671 35.479 38.932 41.401
22 8.643 9.542 10.982 12.338 33.924 36.781 40.289 42.796
23 9.260 10.196 11.689 13.091 35.172 38.076 41.638 44.181
24 9.886 10.856 12.401 13.848 36.415 39.364 42.980 45.559
25 10.520 11.524 13.120 14.611 37.652 40.646 44.314 46.928
Entries are c

such that Pr(


2
v
> c

) = , e.g. Pr(
2
6
> 14.449) = 0.025.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 22/28


For a lower one-tail test at the 5% level, we would want to
nd the value that puts 5% of the distribution into the lower
tail (as in the diagram).
In the table the 5% critical values are in the column headed
0.95, because 95% of the distribution lies to the right of the
reported value.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 23/28
Let c

denote the critical value.


The test statistic is
TS =
(n 1)s
2

2
0

2
n1
under H
0
,
where
2
0
is the value of
2
under H
0
.
The test criterion is:
upper one-tail test: if TS > c

, reject H
0
, but
if TS < c

, reserve judgement;
lower one-tail test: if TS < c

, reject H
0
, but
if TS > c

, reserve judgement.
Lets see this test working in practice.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Testing Hypotheses About Population Variances 24/28
Example (continued). It is claimed that the standard
deviation of income in a large city does not exceed 1600.
Test this hypothesis at the 5% level of signicance.
Solution (continued). Here,
2
0
= 1600
2
and so we have a
lower one-tail test with
H
0
:
2
= 1600
2
and H
A
:
2
< 1600
2
.
We found s
2
= 2, 831, 111 with a sample of size n = 10.
Hence
TS =
9 2, 831, 111
2, 560, 000
= 9.95.
The 5% lower-tail critical value from the
2
9
distribution is
3.325. As TS = 9.95 > 3.325 we do not reject H
0
.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
p-values 25/28
The test criteria (or decision rules) have required us to
compare the value of our test statistic, TS, with a critical
value at, say, the 5% level of signicance.
Rejection, or non-rejection, of H
0
depends on the
signicance level chosen.
For example, we may reject H
0
at the 10% level but not at
the 5% level.
It is common in statistics (and econometrics) to compute
p-values associated with test statistics.
The p-value may be dened as the level of signicance at
which H
0
can be rejected for a given value of the test
statistic TS.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
p-values 26/28
For example, the p-value for an upper one-tail z-test is
equal to Pr(Z > TS), while for a two-tail test it is equal to
Pr(Z > |TS|).
The test criterion at signicance level can be written in
terms of the p-value:
reject H
0
if p-value < ; do not reject otherwise.
For example, a p-value of 0.03 would result in rejection of
H
0
at the 5% level, but a p-value of 0.07 would not.
Thomas (pp.171172) shows how p-values can be
interpolated from the relevant statistical tables.
In practice p-values are typically computed using computer
software (e.g. Stata).
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
More on the t and
2
Distributions 27/28
A
2
n
variable is dened as the sum of n squared
independent N(0, 1) variables, Z
1
, . . . , Z
n
:

2
n
= Z
2
1
+ Z
2
2
+. . . + Z
2
n
.
Its expected value is n because E(Z
2
i
) = 1 for all i:
E(
2
n
) = E(Z
2
1
) + E(Z
2
2
) +. . . + E(Z
2
n
) = n.
The variance is equal to 2n.
A t variable can be dened as the ratio of a N(0, 1) variable,
Z
0
, to the square root of an independent
2
n
divided by n:
t
n
=
Z
0

2
n
/n
.
The mean is zero and the variance is n/(n 2) for n > 2.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II
Summary 28/28
Summary
Small samples and Students t-distribution
Testing hypotheses about population variances
p-values.
Next week:
Joint and marginal distributions; covariances.
EC114 Introduction to Quantitative Economics 8. Hypothesis Testing II

You might also like