Fundamentals of Hypothesis Testing

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 20

1

FUNDAMENTALS of HYPOTHESIS TESTING



The Hypothesis
A hypothesis is a claim (assumption) about a
population parameter:
population mean
population proportion
Example: The mean monthly cell phone bill of this
city is = $52
Example: The proportion of adults in this city with
cell phones is = .68


The Null Hypothesis, H
0
3 : H
0
=
States the assumption (numerical) to be tested
Example: The mean number of TV sets in U.S.
Homes is equal to three.
Is always about a population parameter, not about
a sample statistic.



2

The Null Hypothesis, H
0
Begin with the assumption that the null
hypothesis is true
Similar to the notion of innocent until
proven guilty
It refers to the status quo
Always contains = , or > sign
May or may not be rejected


The Alternative Hypothesis, H
1
Is the opposite of the null hypothesis
e.g., The mean number of TV sets in U.S.
homes is not equal to 3 ( H
1
: 3 )
Challenges the status quo
Never contains the = , or > sign
May or may not be proven
Is generally the hypothesis that the
researcher is trying to prove




3

The Hypothesis Testing
Process
Claim: The population mean age is 50.
H
0
: = 50, H
1
: 50
Sample the population and find sample mean.
Population
Sample


The Hypothesis Testing
Process
Suppose the sample mean age was X = 20.
This is significantly lower than the claimed mean
population age of 50.
If the null hypothesis were true, the probability of
getting such a different sample mean would be very
small, so you reject the null hypothesis .
In other words, getting a sample mean of 20 is so
unlikely if the population mean was 50, you
conclude that the population mean must not be 50.



4

The Hypothesis Testing
Process
Sampling
Distribution of X
= 50
If H
0
is true
If it is unlikely that you
would get a sample
mean of this value ...
... then you reject
the null hypothesis
that = 50.
20
... if in fact this were
the population mean
X

The Test Statistic and
Critical Values
If the sample mean is close to the assumed
population mean, the null hypothesis is not
rejected.
If the sample mean is far from the assumed
population mean, the null hypothesis is
rejected.
How far is far enough to reject H
0
?
The critical value of a test statistic creates a
line in the sand for decision making.

5

The Test Statistic and
Critical Values
Critical Values
Distribution of the test statistic
Region of
Rejection
Region of
Rejection

Errors in Decision Making
Type I Error
Reject a true null hypothesis
Considered a serious type of error
The probability of a Type I Error is o
Called level of significance of the test
Set by researcher in advance
Type II Error
Failure to reject false null hypothesis
The probability of a Type II Error is

Errors in Decision Making
6

Level of Significance,
H
0
: 50
H
1
: < 50
0
H
0
: 50
H
1
: > 50
o
o
Represents
critical value
Lower-tail test
0
Upper-tail test
Two-tail test
Rejection
region is
shaded
0
H
0
: = 50
H
1
: 50
Claim: The population
mean age is 50.
o/2
o/2


Possible Hypothesis Test Outcomes

Actual Situation
Decision H
0
True H
0
False
Do Not
Reject H
0

No Error
Probability 1 -
Type II Error
Probability
Reject H
0
Type I Error
Probability
No
ErrorProbability
1 -
7


Hypothesis Testing: Known
For two tail test for the mean, known:
Convert sample statistic ( X ) to test statistic
Determine the critical Z values for a specified
level of significance o from a table
Decision Rule: If the test statistic falls in the rejection
region, reject H
0
; otherwise do not reject H
0
n

X
Z

=

Hypothesis Testing: Known
Example: Test the claim that the true mean weight of
chocolate bars manufactured in a factory is 3 ounces.
State the appropriate null and alternative hypotheses
H
0
: = 3 H
1
: 3 (This is a two tailed test)
Specify the desired level of significance
Suppose that o = .05 is chosen for this test
Choose a sample size
Suppose a sample of size n = 100 is selected


8

Hypothesis Testing: Known
2.0
.08
.16
100
0.8
3 2.84
n

X
Z =

=
Determine the appropriate technique
is known so this is a Z test
Set up the critical values
For o = .05 the critical Z values are 1.96
Collect the data and compute the test statistic
Suppose the sample results are
n = 100, X = 2.84
( = 0.8 is assumed known from past company records)
So the test statistic is:

Hypothesis Testing: Known
Reject H
0
Do not reject H
0
Is the test statistic in the rejection region?
o = .05/2
-Z= -1.96 0
Reject H
0
if
Z < -1.96 or
Z > 1.96;
otherwise do
not reject H
0
o = .05/2
Reject H
0
+Z= +1.96
Here, Z = -2.0 < -1.96, so the test
statistic is in the rejection region


9

Hypothesis Testing: Known
Reach a decision and interpret the result
Since Z = -2.0 < -1.96, you reject the null
hypothesis and conclude that there is sufficient
evidence that the mean weight of chocolate
bars is not equal to 3.




Hypothesis Testing: Known
6 Steps of Hypothesis Testing:
1. State the null hypothesis, H
0
and state the
alternative hypotheses, H
1
2. Choose the level of significance, , and the sample
size n.
3. Determine the appropriate statistical technique and
the test statistic to use
4. Find the critical values and determine the rejection
region(s)


10


Hypothesis Testing: Known
5. Collect data and compute the test statistic from the
sample result
6. Compare the test statistic to the critical value to
determine whether the test statistic falls in the
region of rejection. Make the statistical decision:
Reject H
0
if the test statistic falls in the rejection
region. Express the decision in the context of the
problem

Hypothesis Testing: Known
p-Value Approach
The p-value is the probability of obtaining a
test statistic equal to or more extreme ( < or
> ) than the observed sample value given H
0
is true
Also called observed level of significance
Smallest value of o for which H
0
can be
rejected

11

Hypothesis Testing: Known
p-Value Approach
Convert Sample Statistic (ex. X) to Test
Statistic (ex. Z statistic )
Obtain the p-value from a table or by using
Excel
Compare the p-value with o
If p-value < o , reject H
0
If p-value > o , do not reject H
0

Hypothesis Testing: Known
p-Value Approach
Example: How likely is it to see a sample mean of
2.84 (or something further from the mean, in either
direction) if the true mean is = 3.0?
.0228 2.0) P(Z
.0228 2.0) P(Z
= >
= <
X = 2.84 is translated to a Z
score of Z = -2.0
p-value
=.0228 + .0228 = .0456
.0228
o/2 = .025
-1.96 0
-2.0
Z 1.96
2.0
.0228
o/2 = .025

12

Hypothesis Testing: Known
One Tail Tests
In many cases, the alternative hypothesis
focuses on a particular direction
H
0
: 3
H
1
: < 3
H
0
: 3
H
1
: > 3
This is a lower-tail test since the
alternative hypothesis is focused on the
lower tail below the mean of 3
This is an upper-tail test since the
alternative hypothesis is focused on the
upper tail above the mean of 3



Hypothesis Testing: Known
Lower Tail Tests
There is only one critical value, since the
rejection area is in only one tail.
Reject
H
0
Do not reject
H
0

-Z

Z
X
Critical value

13

Hypothesis Testing: Known
Upper Tail Tests
There is only one critical value, since the
rejection area is in only one tail.
Reject
H
0
Do not reject
H
0

Critical value
Z
X





Hypothesis Testing: Known
Upper Tail Test Example
A phone industry manager thinks that customer
monthly cell phone bills have increased, and now
average more than $52 per month. The company
wishes to test this claim. Past company records
indicate that the standard deviation is about $10.
H
0
: 52 the mean is less than or equal to than $52 per month
H
1
: > 52 the mean is greater than $52 per month
(i.e., sufficient evidence exists to support the
managers claim)
Form hypothesis test:

14

Hypothesis Testing: Known
Upper Tail Test Example
Suppose that o = .10 is chosen for this test
Find the rejection region:
Reject H
0
Do not reject H
0
o = .10
Z
0
Reject H
0
1-o = .90

Hypothesis Testing: Known
Upper Tail Test Example
What is Z given a = 0.10?
Z .07 .09
1.1 .8790.8810 .8830
1.2 .8980 .9015
1.3 .9147 .9162 .9177
z
0 1.28
.08
a = .10
Critical Value
= 1.28
.90
.8997
.10
.90


15

Hypothesis Testing: Known
Upper Tail Test Example
Obtain sample and compute the test statistic.
Suppose a sample is taken with the following
results: n = 64, X = 53.1 (o=10 was
assumed known from past company records)
Then the test statistic is:
0.88
64
10
52 53.1
n

X
Z =

=


Hypothesis Testing: Known
Upper Tail Test Example
Reach a decision and interpret the result:
o = .10
1.28
0
Reject H
0
1-o = .90
Z = .88
Do not reject H
0
since Z = 0.88 1.28
i.e.: there is not sufficient evidence that the mean bill is greater than $52

16

Hypothesis Testing: Known
Upper Tail Test Example
Calculate the p-value and compare to o
Reject
H
0
o = .10
Do not reject
H
0
1.28
0
Reject H
0
Z = .88
.1894
.8106 1 0.88) P(Z
64 10/
52.0 53.1
Z P
53.1) X P(
=
= > =
|
.
|

\
|
> =
>
p-value = .1894
Do not reject H
0
since p-value = .1894 > o = .10

Hypothesis Testing:
Unknown
Recall that the t test statistic with n-1
degrees of freedom is:
n
S
X
t
1 - n

=

17

Hypothesis Testing:
Unknown
If the population standard deviation is
unknown, you instead use the sample
standard deviation S.
Because of this change, you use the t
distribution instead of the Z distribution to
test the null hypothesis about the mean.
All other steps, concepts, and conclusions are
the same.

Hypothesis Testing:
Unknown Example
The mean cost of a hotel room in New York is said
to be $168 per night. A random sample of 25 hotels
resulted in X = $172.50 and S = 15.40. Test at the
o = 0.05 level.
(A stem-and-leaf display and a normal probability plot
indicate the data are approximately normally distributed )
H
0
: = 168
H
1
: = 168

18

Hypothesis Testing:
Unknown Example
H
0
: = 168
H
1
: 168
= 0.05
n = 25
o is unknown, so
use a t statistic
Critical Value:
t
24
= 2.0639
Reject H
0
Reject H
0
/2=.025
-t
n-1,/2
Do not reject H
0
0
/2=.025
-2.0639 2.0639
t
n-1,/2
Determine the regions of rejection

Hypothesis Testing:
Unknown Example
a/2=.025
-t
n-1,/2
0
a/2=.025
-2.0639 2.0639
t
n-1,/2
1.46
25
15.40
168 172.50
n
S
X
t
1 n
=

Do not reject H
0
: not sufficient evidence
that true mean cost is different from $168
1.46

19

Hypothesis Testing:
Unknown
Recall that you assume that the sample
statistic comes from a random sample from a
normal distribution.
If the sample size is small (< 30), you should
use a box-and-whisker plot or a normal
probability plot to assess whether the
assumption of normality is valid.
If the sample size is large, the central limit
theorem applies and the sampling
distribution of the mean will be normal.

SOAL:
1. A random sample of size 20, from a normal population, has mean = 182 and s = 2.3. Test
0
1
: 1.81
: 181
H
H

=
>
With = 0.05

2. Heights were measured for 12 plants grown under the treatment of a particular
nutrient. The sample mean and standard deviation of those measurements were and 10
inches, respectively.

3. Measurements of the acidity (pH) of rain samples were recorded at 13 sites in an
industrial region.

3.5 5.1 5.0 3.6 4.8 3.6 4.7 4.3 4.2 4.5 4.9
4.7 4.8
Determine a 95% confidence interval for the mean acidity of rain in that
region.
4. A physical model suggests that the mean temperature increase in the water used as
coolant in a compressor chamber should not be more than 5
0
C. Temperature increases
in the coolant measured on 8 independent runs of the compressing unit revealed the
following data:
6.4 4.3 5.7 4.9 6.5 5.9 6.4 5.1
a. Do the data contradict the assertion of the physical model? (Test at
20

=0.05) State the assumption you make about the population.
b. Determine a 95% confidence interval for the mean increase of the
temperature in the coolant.
5. The average weekly earnings for all full-time equivalent employees are
reported to be $344.Suppose that you want to check this claim sice you
believe it is too low. You want to prove that average weekly earnings of all
employees are higher that the amount stated. You collect a random sample
of 1,200 employees in all areas and find that sample mean is $361 and the
sample standard deviation $110. Can you didisprove the claim?

6. According to Money, the average amount of money that a typical person in
the United States would need to make him or her feel rich is $1.5 million. A
researcher wants to test this claim. A random sample of 100 people in the
United States reveales that their mean amount to feel rich is $2.3 milion
and the standard deviation is $0.5 milion. Conduct the test.

You might also like