Sei sulla pagina 1di 13

Probability and Statistics

LECTURE 7
INTRODUCTION TO HYPOTHESIS
TESTING

Adapted from http://www.prenhall.com/mcclave


8-1

Outline

1. Distinguish Types of Hypotheses


2. Describe the basics of hypothesis
testing
3. Explain the z-test for mean

8-2

Statistical Methods

8-3
Hypothesis Testing
I believe the
population Reject
mean age is 50 hypothesis!
Population (hypothesis). Not close.

 

 
 Random
 sample
Mean
X = 20
8-4

Hypothesis Testing

A hypothesis test allows us to draw


conclusions or make decisions
regarding population data from
sample data.

8-5

What’s a Hypothesis?

Usually a statement about population


parameters
 Parameter Is Population Mean,
Proportion, Variance
 Must Be Stated
Before Analysis

8-6
Example of hypothesis

The label on soft drink bottle states that it


contains 67.6 fluid ounces. Is there
evidence the label is incorrect?
What is the hypothesis in the above
context?

8-7

Research Hypothesis

• What we aim to show statistically


• Statement we hope or suspect is true
• Denoted as Ha or H1
• Convention: no equality sign
• Also called alternative hypothesis

8-8

Null Hypothesis
• Theory put forward because
 Believed to be true or used as starting point for
testing. So we assume Ho is true and use the
information specified in Ho as a starting point for
testing.
 Not been proved
• Opposite of Research Hypothesis
• Convention: contain equality sign
• Usually phrased as “no effect”, “no difference”
• Called H0
8-9
Setting up hypotheses

• When doing exams, you will write Ho


before Ha. But to correctly figure out
hypotheses, you should write Ha first,
then the Ho. Normally, Ha contains the
question we wish to answer.
• Take into account the convention

8 - 10

Identifying Hypotheses
Steps
1.Example Problem: Test That the
Population Mean Is Not 3
2.Steps
 State the Question Statistically (  3)
 State the Opposite Statistically ( = 3)
 Must Be Mutually Exclusive & Exhaustive
 Select the Alternative Hypothesis (  3)
 Has the , <, or > Sign
 State the Null Hypothesis ( = 3)
8 - 11

What Are the Hypotheses?

Is the population average amount of TV


viewing 12 hours?
State the question statistically:  = 12
State the opposite statistically:   12
Select the alternative hypothesis: Ha:   12
State the null hypothesis: H0:  = 12

8 - 12
What Are the Hypotheses?

Is the population average amount of TV


viewing different from 12 hours?
State the question statistically:   12
State the opposite statistically:  = 12
Select the alternative hypothesis: Ha:   12
State the null hypothesis: H0:  = 12

8 - 13

What Are the Hypotheses?

Is the average cost per hat less than or


equal to $20?
State the question statistically:   20
Select the alternative hypothesis: Ha:  < 20
State the null hypothesis: H0:   20

8 - 14

What Are the Hypotheses?

Is the average amount spent in the


bookstore greater than $25?
State the question statistically:   25
State the opposite statistically:   25
Select the alternative hypothesis: Ha:   25
State the null hypothesis: H0:   25

8 - 15
Jury trial example

• Begin with idea the defendant is innocent


• Collect data (evidence)
• Convict if data are sufficiently inconsistent
with the initial idea
• What should be our null hypothesis and
alternative hypothesis?

8 - 16

Possible conclusions of a
hypothesis test

2 possible conclusions:
• Do not reject Ho: test is not significant
• Reject Ho: test is significant

Question: in the jury trial example, what


are the possible conclusions?

8 - 17

Possible errors in testing

• Type I error: reject Ho if Ho is true


• Type II error: do not reject Ho if Ho is
false

Question: identify Type I and Type II


errors in the jury trial example.

8 - 18
Possible errors in testing

• Probability of type I error: alpha


 Significance level
• Probability of type II error: beta

8 - 19

Jury Trial Results

H0: Innocent

8 - 20

Significance level

• Denoted a
• Probability of making Type I error
• Equals Total Area of Rejection Region
• Should be decided by researcher at
start
• Example Values Are .01, .05, .10, etc.

8 - 21
One-tailed vs. Two-tailed
tests

If we want to test population mean is


• greater than 100 (right-tailed)
• smaller than 100 (left-tailed)
• different from 100 (two-tailed)

8 - 22

A problem

If we aim to collect evidence to show that


the population mean is greater than 100.
• Let’s write down the hypotheses?
• Sample mean is used to estimate population
mean. Sample means vary from sample to
sample (described by sampling distribution)
• What values of the sample means support
the alternative hypothesis?
• When should we reject the null hypothesis?
8 - 23

Rejection region (right-tailed test)

H0:  = a
Ha:  > a

Exercise: let’s draw the rejection region.


Remember that a equals total Area of Rejection
Region. Choose a small value of a as an
example.
You should now be convinced why the test is
called right-tailed.
8 - 24
Test statistic

• Now we select a random sample from


population and calculate the sample mean.
The calculated sample mean becomes our
test statistic, as it contains evidence from the
selected sample (evidence can be against or
not against Ho)
• If test statistic falls in rejection region, we
reject Ho. Otherwise, we do not reject Ho.

8 - 25

One population tests

One
population

Mean Proportion

Z Test
 Z Test T Test

8 - 26

One-Tailed Z Test
for Mean ( Known)
1.Assumptions
 Population Standard Deviation Is Known
 Population Is Normally Distributed
 If Population Is Not Normal, Large Sample
Size (so that the CLT holds) Is Required (In
This Case, The Sampling Distribution of
Sample Mean Will Be Approximately Normal)
2. Alternative Hypothesis Has < or > Sign
3. Z-Test Statistic
8 - 27
One-Tailed Z Test
for Mean Hypotheses
H0:=a Ha: < a H0:=a Ha: > a

Reject H0 Reject H0
a a

a X a X

Must be significantly Small values give no


below  evidence against H0 in
favor of Ha. Don’t
8 - 28 reject!

One-Tailed Z Test
Finding Critical Z
To make rejection decision, we need to find out
critical value. Converting from to Z makes this
process easier.
What Is Za given a = .025?

a = .025

8 - 29

Right-Tailed Z Test
Example
Does an average box of
cereal contain more
than 368 grams of
cereal? A random
sample of 25 boxes
showedX = 372.5.
The company has
specified  to be 15
368 gm.
grams. Test at the .05
level. Assume normal
8 - 30 population.
Right-Tailed Z Test
Solution
Test Statistic:
H0:  = 368
Ha:  > 368
a = .05
n = 25
Critical Value(s): Decision:
Do not reject at a = .05
Conclusion:
No evidence average
is more than 368
8 - 31

Left-tailed Z test

Suppose we want to test population


mean < 100 using Z test with significance
level of 0.01. The calculated Z test
statistic is -2.5. What is the rejection
region? What is the decision?

8 - 32

Writing conclusions

2 cases:
•Reject Ho:
•Do not reject Ho:

8 - 33
Two-Tailed Z Test
for Mean ( Known)
1.Assumptions
 Population Standard Deviation Is Known
 Population Is Normally Distributed
 If Population Is Not Normal, Large Sample
Size (n  30) Is Required (In This Case,
The Sampling Distribution of Will Be
Approximately Normal)
2. Alternative Hypothesis Has  Sign
3. Z-Test Statistic:
8 - 34

Two-Tailed Z Test
Example
Does an average box of
cereal contain 368
grams of cereal? A
random sample of 25
boxes showedX =
372.5. The company
has specified  to be
15 grams. Test at the 368 gm.
.05 level. Assume
8 normal
- 35 population.

Two-Tailed Z Test
Solution
Test Statistic:
H0:  = 368
Ha:   368
a  .05
n  25
Critical Value(s): Decision:
Do not reject at a = .05
Conclusion:
No evidence
average is not 368
8 - 36
Hypothesis testing
common pitfalls
 Choose or change hypotheses after looking at
data

 Choose or change level of significance after


looking at data

 Do not reject Ho  accept Ho without


considering power (1-)

8 - 37

Conclusion

1. Distinguish Types of Hypotheses


2. Describe the basics of hypothesis
testing
3. Explain the z-test for mean

8 - 38

Potrebbero piacerti anche