You are on page 1of 32

Tests of Hypothesis

For Means and Proportions

Quantitative Methods for Economics
Dr. Katherine Sauer
Metropolitan State College of Denver
Chapter Overview:

I. Hypothesis Tests for Means
II. Type I and Type II Errors
II. Hypothesis Tests for Proportions
IV. Hypothesis Test for Difference in Means
V. Hypothesis Test for Difference in Proportions

I. Hypothesis Tests for Means

A null hypothesis is a claim about a population characteristic.
H0

Ex: A property developer makes a claim that the average annual
rental income per student is at most \$5000.
H0: < 5000
If the null hypothesis is rejected, then the alternative hypothesis
prevails.

The alternative hypothesis is the complement of the null.
H1 HA

Ex: If H0: < 5000, then H1: > 5000

The null hypothesis is usually a statement about the status quo
and its expression always contains the equality.
Ex: A property developer claims the average rental income per
room in student housing is at most \$5000 for the year. A sample of
36 students is randomly selected. The mean annual rent is
calculated to be \$5200 from this sample. The standard deviation for
all rents is \$735.

1. State the null and alternative hypothesis.
H0: < 5000
H1: > 5000

Because the alternative hypothesis only refers to
values greater than 5000, well use a one-sided test
(upper tail).
2. Decide at what level of probability the null hypothesis will be
rejected.
- the null hypothesis will be rejected if the p-value is less
than a given probability
- usually 0.05 or 0.01

For this example, lets use = 0.05.

3. Sketch the curve and identify the critical region.
for = 0.05 Z0.05 = 1.6449
= 5000
Z = 1.6449
Reject
H0
Accept H0
Accept H0 if Z <1.6449

Reject H0 if Z > 1.6449
x
H
x
x
Z
o

=
n
x
o
o =
4. Calculate Z:
5 . 122
36
735
= =
n
x
o
o 63 . 1
5 . 122
5000 5200
=

=
x
Z
= 5000
Z = 1.6449
Reject
H0
Accept H0
Z = 1.63
Accept H0 because
1.63 <1.6449.

5. Calculate the p-value.

The p-value is the area under the curve and to the right of our
sample Z.
look up 1.63 in the table

p-value = 0.0516
= 5000
Z = 1.6449
Reject
H0
Accept H0
Z = 1.63
Close to 0.05, but not
close enough.
Ex: A property developer claims the average rental income per
room in student housing is at least \$5000 for the year. A sample of
36 students is randomly selected. The mean annual rent is
calculated to be \$5200 from this sample. The standard deviation for
all rents is \$735. Use = 0.05

1. State the null and alternative hypothesis.
H0: > 5000
H1: < 5000

Because the alternative hypothesis only refers to
values less than 5000, well use a one-sided test
(lower tail).
2. Sketch the curve and identify the critical region.
for = 0.05 Z0.05 = -1.6449
= 5000
Z = -1.6449
Reject
H0
Accept H0
Accept H0 if Z >-1.6449

Reject H0 if Z < -1.6449
x
H
x
x
Z
o

=
n
x
o
o =
3. Calculate Z:
5 . 122
36
735
= =
n
x
o
o 63 . 1
5 . 122
5000 5200
=

=
x
Z
= 5000
Z = -1.6449
Z = 1.63
Accept H0 because
1.63 > -1.6449.

Reject
H0
Accept H0
4. Calculate the p-value.

The p-value is the area under the curve and to the left of our
sample Z.
look up 1.63 in the table
0.0516

1 0.0516 = 0.9484
Comparing the two scenarios:

H0: < 5000
H1: > 5000
Accept the null hypothesis that the true mean is less than
or equal to \$5000 with a p-value of 0.0516.

H0: > 5000
H1: < 5000
Accept the null hypothesis that the true mean is greater
than or equal to \$5000 with a p-value of 0.9485.

Ex: A property developer claims the average rental income per
room in student housing is \$5000 for the year. A sample of 36
students is randomly selected. The mean annual rent is calculated to
be \$5200 from this sample. The standard deviation for all rents is
\$735. Use = 0.05

1. State the null and alternative hypothesis.
H0: = 5000
H1: 5000

Because the alternative hypothesis refers to all
values other than 5000, well use a two-sided test.

2. Sketch the curve and identify the critical region.
for = 0.05 /2 = 0.025 Z0.025 = 1.96
= 5000
Z = -1.96
Reject
H0
Accept H0
Accept H0 if
-1.96 < Z < 1.96

Reject H0 if
Z < -1.96 or Z > 1.96
Z = 1.96
Reject
H0
x
H
x
x
Z
o

=
n
x
o
o =
3. Calculate Z:
5 . 122
36
735
= =
n
x
o
o 63 . 1
5 . 122
5000 5200
=

=
x
Z
= 5000
Z = -1.96
Reject
H0
Accept H0
Z = 1.96
Reject
H0
Z = 1.63
Accept H0 because
-1.96 < 1.63 < 1.96

4. Calculate the p-value.

The p-value is the area under the curve and to the left of -1.63
and the area under the curve to the right of 1.63.
look up 1.63 in the table
0.0516
p-value = 0.0516 + 0.0516
p-value = 0.1032
The Relationship between Confidence Intervals
and Hypothesis Testing

Same example: Lets calculate the 95% confidence interval.
x
Z x o
o 2 /

5200 + 1.96(122.5)
5200 + 240.1

4959.9 to 5440.1
We are 95% sure that the population mean is between \$4959.9
and \$5440.1.

Since the claim is = 5000, our CI supports the claim.
A two-sided Confidence Interval is a set of acceptable two-
sided null hypotheses at the same level of significance.
(same argument for one-sided CIs and hypotheses)
II. Type I and Type II errors

If a sample mean falls in the acceptance region, we say
there is no significant difference between the
sample mean and the hypothesized population mean.

If the sample mean falls in the rejection region, we say
there is a significant difference between the sample
mean and the hypothesized population mean.

- the difference is too great to attribute to chance
If you reject the null when it is actually true, it is called a Type I
error.

is the probability of committing a Type I error.

If you reject the alternative hypothesis when it is actually true, it is
called a Type II error.

is the probability of committing a Type II error.
The power of a test is the probability of accepting a true
alternative hypothesis.

The power of a test is also defined as the probability of rejecting
a false null hypothesis.

The power of a test increases as increases.
III. Hypothesis tests for Proportions
Ex: A Budget airline claims that 96% of its flights depart on time. A
researcher working for the company records departure information
for 80 randomly selected flights and finds that 5 departed late. Test
the airlines claim at the 1% significance level.

1. State the null and alternative hypotheses
p = 5/80 = 0.0625 departed late
= 0.96 depart on time so = 0.04 departed late

H0: = 0.04
H1: 0.04
(2-sided test)
2. Sketch the curve and identify the critical region.
for = 0.01 /2 = 0.005 Z0.005 = 2.5758
=0.04
Z = -2.5758
Reject
H0
Accept H0
Accept H0 if
-2.5758 < Z < 2.5758

Reject H0 if
Z < -2.5758 or Z > 2.5758
Z = 2.5758
Reject
H0
3. Calculate Z:
0274 . 1
0219 . 0
04 . 0 0625 . 0
=

=
p
Z
p
p
p
Z
o
t
=
n
s
p
) 1 ( t t
=
0219 . 0
80
) 04 . 0 1 ( 04 . 0
=

=
p
s
=0.04
Z = -2.5758
Reject
H0
Accept H0
Z = 2.5758
Reject
H0
Z = 1.0274
Accept H0 because
-2.5758<1.0274< 2.5758

Accept the null hypothesis that 4% of flights are late.

Validate the claim that 96% of flights are on time.

4. p-value is the area to the left of -1.0274 and to the right of
1.0274 (round to 1.03 in the table)
p-value = 0.1515 + 0.1515
= 0.3030
Alternative:

| p | = | 0.04 0.0625| = 0.0225

0.04 + 0.0225 = 0.0625
0.04 0.0225 = 0.0175

p-value = pr( p > 0.0625) + pr( p < 0.0175)

0.0625 = x / 80 x = 5
0.0175 = x / 80 x = 1.4

If the true percentage of late departures is 4%, there is a 30%
chance of selecting 5 or more late departures or 1.4 or fewer
departures in 80.
IV. Hypothesis Test for Difference in Means
Ex: A group of students and a group of young professionals are
Is there a difference in the average rental expenditure between
the two groups? (5% significance level)

1. State the null and alternative hypotheses
H0: A = B sometimes written as A - B = 0
H1: A B
(2-sided test)
2. Sketch the curve and identify the critical region.
for = 0.05 /2 = 0.025 Z0.025 = 1.96
A - B = 0
Z = -1.96
Reject
H0
Accept H0
Accept H0 if
-1.96 < Z < 1.96

Reject H0 if
Z < -1.96 or Z > 1.96
Z = 1.96
Reject
H0
3. Calculate Z:
2046 . 2
0089 . 127
) 0 ( ) 4920 5200 (
=

=
B x A x
Z
B x A x
B A B A
B x A x
s
x x
Z

=
) ( ) (
B
B
A
A
B x A x
n
s
n
s
s
2 2
+ =

0089 . 127
45
) 225 (
36
) 735 (
2 2
= + =
B x A x
s
=0.04
Z = -2.5758
Reject
H0
Accept H0
Z = 2.5758
Reject
H0
Z = 2.2046
Accept H0 because
-2.5758<2.2046< 2.5758

4. p-value
p-value = pr(Z>2.20) + pr(Z< -2.20)
= 0.0139 + 0.0139
= 0.0278

There is a 2.78% chance that 2 sample means will differ by
5200 4920 = 280 or more when the population means
are equal
V. Hypothesis Test for Difference in Proportions
When testing whether or not two population proportions are
different, combine the two sample proportions into a pool.

pc = # items with given characteristic in both samples
sum of all items in both samples
|
|
.
|

\
|
+ =

B A
c c combined pB pA
n n
p p s s
1 1
) 1 (
Ex: Test the hypothesis that the support for the Green Party is the
same in both areas. Use 10% significance.

1. State the null and alternative hypotheses
H0: A = B
H1: A B

Calculate pc 88+54 = 142 =0.3944
200+160 360
2. Sketch the curve and identify the critical region.
for = 0.10 /2 = 0.05 Z0.005 = 1.6449
A - B = 0
Z = -1.6449
Reject
H0
Accept H0
Accept H0 if
-1.6449 < Z < 1.6449

Reject H0 if
Z < -1.6449 or Z > 1.6449
Z = 1.6449
Reject
H0
3. Calculate Z:
pB pA
B A B A
pB pA
s
p p
Z

=
) ( ) ( t t
|
|
.
|

\
|
+ =

B A
c c pB pA
n n
p p s
1 1
) 1 (
0518 . 0
160
1
200
1
) 3944 . 0 1 ( 3944 . 0 =
|
.
|

\
|
+ =
pB pA
s
9788 . 1
0518 . 0
) 0 ( ) 3375 . 0 44 . 0 (
=

=
pB pA
Z
Z = -1.6449
Reject
H0
Accept H0
Z = 1.6449
Reject
H0
Z = 1.98
Reject H0 because
1.98>1.6449

4. p-value
p-value = pr(Z>1.98) + pr(Z< -1.98)
= 0.0239 + 0.0239
= 0.0478

When the null hypothesis is rejected, the p-value is the level of
significance.
A - B = 0
Concepts:
Type I, Type II errors
Power of a test

Skills:
Perform Hypothesis Tests for means, proportions, differences in
means, differences in proportions