Sie sind auf Seite 1von 62

Section 6

Hypothesis Testing for One


Population Mean

Learning Objectives
Testing company claims
One and two tail tests
Rejection regions
P values
Experimental data analysis

The Logic of Hypothesis


Testing
Example: Suppose a company
manufactures what are supposed to be
9 volt batteries. Normally, the
batteries manufactured should have 9
volts. However, sometimes a battery
can be defective and have less (or
more) than 9 volts. How would you test
to see if, on average, the mean voltage
of ALL batteries is likely to be 9 volts?
3

The Logic of Hypothesis


Testing
Well ASSUME the hypothesis that the
population mean equals 9 volts is
actually true.
Well then take a SAMPLE of these
batteries, and find the sample mean
and standard deviation of the voltages.

The Logic of Hypothesis


Testing
If you get a rare sample (that is, the
sample mean is very different from 9,
taking the standard deviation into
account) then we DOUBT that this
hypothesis is true.
We would then REJECT this
hypothesis, in favour of ANOTHER
hypothesis.
5

The Logic of Hypothesis


Testing
On the other hand, if we get a sample
that is ok, then we would accept this
original hypothesis that the population
mean is likely to be 9 volts.

Terminology
The hypothesis we assume to be true
at the beginning (eg, population mean
equals 9 volts) is called the NULL
HYPOTHESIS, denoted H0.
If the null hypothesis is rejected, then
the other hypothesis we then accept as
true is called the ALTERNATE
HYPOTHESIS, denoted Ha.
Stated BEFORE data is collected!
7

Example: Writing H0 and Ha


In our 9 volt battery example, we have:
H0: = 9 volts
Ha: 9 volts

The Null Hypothesis


In this course, it will always look like:
H0: = M
That is, it always has an affirmative
connotation (population parameter
EQUALS some number M).
9

The Alternate Hypothesis


Always says something that
CONTRADICTS the null hypothesis.
Can have THREE forms:

10

Tail Type
The alternate hypothesis defines the
Tail Type of the test:
Ha: < M
Ha: > M
Ha: M
11

Battery Example
In our 9 volt battery example, we had
H0: = 9 volts
Ha: 9 volts
This is therefore a

tail test.

12

In Class Exercise 6.1


For the following, determine the null
and alternate hypotheses. Also, state
whether it is a left, right, or two tail test.

13

In Class Exercise 6.1


1. In 1999, the mean tuition rate of
Canadian universities was $3100 per
term. I want to know if the 2011 mean
tuition rate is higher.
2. A potato chip maker is supposed to put
75 grams of chips into their chip bags.
A consumer group thinks theyre being
cheated, and wants to know if they are
really getting that much.
14

Defining Rareness
According to the logic of hypothesis
testing, we would REJECT H0 if our
sample mean would be RARE if H0
were true.
The question is, how do we define
rare?

15

Defining Rareness: 2 Ways


There are two different, yet equivalent
ways of defining what constitutes a rare
sample.
1. Rejection Regions.
2. P values.
.You can use EITHER to define a rare
sample.
16

Rejection Regions
Uses the (level of significance) of a
confidence interval.
Recall: A (1 )100 percent
confidence interval had
Central area
Equal left and right tail areas of

17

Rejection Regions
Tail area =
/2

Tail area =
/2

Central area
=1-
- Z
- t

Z
t

18

Rejection Regions
Rejection
Rare
Samples
Region

Rejection
Rare
Samples
Region

Common
Samples

- Z
- t

Z
t

19

Rejection Regions
Any sample found to be in the
Rejection Region (RR) is RARE if we
assume H0 is true.
Thus, this gives us sufficient reason to
DOUBT the truth of H0.
We therefore REJECT H0 if we find our sample in the RR.
If our sample is NOT in the RR, we ACCEPT H0.
20

Rejection Regions
Note that the RR was in BOTH tails.
Therefore, what we just did applies to a
TWO TAIL TEST ONLY.

21

Rejection Regions (Right Tail)

22

Rejection Regions (Left Tail)


Rejection
Region

Area = 1 -

Area =

- Z
- t

23

Rejection Regions: Summary


For a LEFT TAIL TEST, the RR is the
LEFT tail ( is ALL in LEFT tail).
For a RIGHT TAIL TEST, the RR is the
RIGHT tail ( is ALL in RIGHT tail).
For a TWO TAIL TEST, the RR is BOTH
tails ( is SPLIT EVENLY between the
two tails).
24

Is the Sample Rare?


Weve defined what IS rare.
How do you tell if your sample fits this
definition?
Use the TEST STATISTIC (TS) of the
sample.

25

Test Statistic
If is KNOWN, the Test Statistic is the
Z score.

If is UNKNOWN, the Test Statistic is


the t score (again, with hypothesized
population mean).
xM

TS t

S/ n
26

How to Decide about H0?


Simple Rule: If your Test Statistic
FALLS IN (or directly on the border of)
the Rejection Region, then the sample
is RARE and hence, you must REJECT
H0 !
If your Test Statistic does NOT fall in
the Rejection Region, you ACCEPT H0.
27

Level of Significance
Note that in all of these tests, the area
of the tail, (or, both tails combined) is
Recall (section 5 part 2) that is called
the LEVEL OF SIGNIFICANCE.
In hypothesis testing, we usually
specify the level of significance rather
than the confidence level.
28

Rejection Region: Examples


Example 1:
Youre testing H0: = 9 vs. Ha: 9.
The population is normal with = 4.
A sample of size 25 gives sample mean
of 9.3.
Decide whether you should reject or
accept H0 at the 5% level of
significance.
Final Answer:
29

Rejection Region: Examples


Example 2:
H0: = 10, Ha: > 10
= 10, we dont know if population is
normal.
Sample of size 64 gives mean of 15.5.
Test the hypothesis at 10% significance.
Final Answer:
30

Rejection Region: Examples


Example 3:
H0: = 3.7, Ha: < 3.7
A sample of size 31 gives sample mean
of 1.95 and sample standard deviation
of 2.1.
Test at the 0.01 level of significance.
Final Answer: Reject H0.
31

In Class Exercise 6.2:


Rejection Regions
Exercise 1: H0:
= 18, Ha: 18.
The population is
known to be normal.
Sample of size 12
gives sample mean
of 17.3 with a
sample standard
deviation of 0.2.
Test at the 0.05 level
of significance.

Exercise 2: H0:
= 73.1, Ha:
> 73.1.
Population is normal
with
= 12. Sample of
size 14 gives
sample mean of
74.8. Test at 90%
confidence.
32

P Values
A completely separate, yet equivalent
way of determining what is rare.
RR is obtained from .
P values are obtained from the Test
Statistic.

33

P Values
A P value (PV) is the probability of
observing a Test Statistic MORE RARE
than the one obtained for the sample.
More rare means further in the tail.

34

P Values: Right Tail Test

TS
(Z or t)

35

P Values: Left Tail Test


PV = area

TS
(Z or T)

36

P Values: Two Tail Test


PV = Sum
of areas

-|TS|

|TS|
37

P Values: Decision Making


REJECT H0 if PV .
ACCEPT H0 if PV > .

38

P Values: For Z and t


For Z, the PV can be USUALLY
calculated exactly since the Z table is
very precise.
For t, you can ONLY get a RANGE for
the PV, due to the reduced precision
(fewer values inside) of the t table.

39

P Values for Z: Examples


Example 1:
H0: = 10, Ha: < 10
= 6.1, we dont know if population is
normal.
Sample of size 64 gives mean of 8.5.
Test the hypothesis at 10% significance.
Final Answer:
40

P Values for Z: Examples


Example 2:
H0: = 27.1, Ha: > 27.1
= 9, population is normal.
Sample of size 21 gives mean of 31.56.
Test the hypothesis at 0.01 level of
significance.
Final Answer:
41

P Values for Z: Examples


Example 3:
Youre testing H0: = 9 vs. Ha: 9.
The population is normal with = 4.
A sample of size 25 gives sample mean
of 9.3.
Decide whether you should reject or
accept H0.
Final Answer: Accept H0.
42

P Values for Z: Examples


Example 4:
H0: = 10, Ha: > 10
= 9.8, we dont know if population is
normal.
Sample of size 64 gives mean of 15.5.
Test the hypothesis at 0.05 level of
significance.
Final Answer: Reject H0.
43

P Values for t
In PRINCIPLE, these should be
calculated the same way as for Z.
But, the t table is less precise.
Thus, the best we can do is find a
RANGE for the PV.
Since the t table gives areas to the
right, well use the Right Tail Test as a
basis for all PVs.
44

P Values for t: Examples


Example 1:
H0: = 0.91, Ha: > 0.91
Population is normal.
Sample of size 25 gives mean of 1.15,
S = 0.65. Test the hypothesis at the
0.05 level of significance.
Final Answer: Reject H0.
45

P Values for t: Examples


Example 2:
H0: = 5, Ha: < 5
Sample of size 50 gives mean of 3.2,
S = 4.1. Test the hypothesis at the 1%
level of significance.
Final Answer: Reject H0.

46

P Values for t: Examples


Example 3:
H0: = 27, Ha: 27
Sample of size 36 gives mean of 25,
S = 8. Test the hypothesis.
Final Answer: Accept H0.

47

In Class Exercise 6.3:


P - Values
Exercise 1: H0:
= 102.1, Ha:
> 102.1
Population is
normal. Sample of
size 11 gives mean
of 110.6, = 15.7.
Test the hypothesis
at 5% significance.

Exercise 2: H0:
= 38.3, Ha:
38.3. Population
is normal. Sample
of size 42 gives
mean of 36.2,
S = 9.5. Test the
hypothesis at 10%
significance.
48

When Can You Use These


Tests?
You have two types of tests.
KNOWN: Use Z.
Called the one sample Z test.

UNKNOWN: Use t.
Called the one sample t test.

49

When Can You Use These


Tests?
In order to use either of these, the
following must be true:
Population is normally distributed (or if not,
sample size is at least 30).
Sample is free of outliers.

50

Experimental Data Analysis


Before doing a hypothesis test, you
MUST check that these conditions are
met.
If they are NOT, then the results of a
hypothesis test are NOT VALID.
The Experimental Data Analysis (EDA)
is done after stating the hypotheses and
collecting data, but BEFORE the
hypothesis test itself.
51

Experimental Data Analysis


Remember RESIDUALS from section
2, part 1.
For EACH data point:
residual = (data point) (sample mean)

ri xi x
52

Experimental Data Analysis


Do a BOXPLOT of the RAW DATA to
detect outliers.
Do a NORMAL PROBABILITY PLOT of
the residuals to determine if your data is
normally distributed (if n < 30).

53

5 Step Method For


Hypothesis Testing

Step 1: State H0 and Ha.


ALWAYS the first step in a
hypothesis test.
54

5 Step Method For


Hypothesis Testing
Step 2:
(a) State the level of significance ().
(b) Design and carry out the experiment.
This is the planning and data collection
phase; done for you in this class. But
in the real world, youll do it yourself.
(c) Do your EDA: Boxplot of raw data to
check for outliers, and normal probability
plot of residuals to check for normality.
55

5 Step Method For


Hypothesis Testing
Step 3: Find the Test Statistic.
TS = Z if population standard
deviation is KNOWN.
TS = t if population standard
deviation is NOT KNOWN.

56

5 Step Method For


Hypothesis Testing
Step 4: Find the Rejection Region OR
P value.
You only need to do ONE of them to
answer the question.
I could ask you to do one specifically, so
you should know BOTH methods.
I could also ask you to use both methods
for the SAME problem.
57

5 Step Method For


Hypothesis Testing
Step 5: Decide whether you reject or
accept the null hypothesis.
State whether it is accepted or rejected.
Then in a sentence or two, explain what
this means for the original research
question.

58

Example 1
A new diet drug claims that it is
effective in helping people lose weight
(positive weight loss). In order to test
this claim, a sample of 33 people using
the diet was taken and the sample
mean weight loss was found to be 0.37
pounds. Suppose it is known that the
population standard deviation of those
who take the drug is 0.98 pounds. The
data is free of outliers. Test the drug
companys claim at the 5 % level
of
59

Example 2
Healthy adults have a mean blood plasma pH
level of 7.4 pH. A new drug for arthritis has
been developed but one of the potential side
effects is an alteration of blood plasma pH
levels. To see if the drug is dangerous, the
pH of the blood plasma of a random sample
of 29 patients who are on the drug were
recorded in Minitab. Test to see if the drug is
safe at the 10% level of significance.
60

Example 3
A beer bottle filling machine is
supposed to dispense 350 mL of beer
into every bottle. In order to make sure
the machine was working properly, a
random sample of 25 bottles that were
filled by this machine was taken. The
data is recorded in Minitab. Is the
machine working properly? Test at the
1 % level of significance.
61

In Class Exercise 6.4


A new type of headache remedy pill is
supposed to have an effective dose of 0.34
mg. In order to make sure the pills are safe
(i.e., the patients are not receiving too much
effective dose), a random sample of 50 pills
was taken and found to have a mean
effective dose of 0.346 mg and sample
standard deviation 0.01 mg. Are the tablets
safe? Use the 0.1 level of significance.
(Show BOTH rejection region AND P
value).
62

Das könnte Ihnen auch gefallen