0% found this document useful (0 votes)
24 views38 pages

2024-Lecture 07

Uploaded by

Nguyễn Tâm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views38 pages

2024-Lecture 07

Uploaded by

Nguyễn Tâm
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Probability and Statistics

LECTURE 7
INTRODUCTION TO HYPOTHESIS TESTING

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


OUTLINE

1. Distinguish Types of Hypotheses


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

7-2
STATISTICAL METHODS

Statistical
Methods

Descriptive Inferential
Statistics Statistics

Hypothesis
Estimation
Testing

7-3
HYPOTHESIS TESTING
I believe the
population
Reject
mean age is 50
hypothesis!
Population (hypothesis). Not close.

J J
J
J J
J Random
J sample
Mean J
J`X = 20
7-4
HYPOTHESIS TESTING

¢ A hypothesis test allows us to


draw conclusions or make decisions
regarding population data from
sample data.

7-5
WHAT’S A HYPOTHESIS?

¢ Usually a statement about population parameters


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

7-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?

7-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

7-8
NULL HYPOTHESIS

• Theory put forward because


— Believed to be true or used as starting point for
testing. So we assume the null hypothesis is true
and use the information specified in it 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
7-9
SETTING UP HYPOTHESES

• When doing exams, you will write H0 before Ha. But


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

7 - 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)

7 - 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

7 - 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

7 - 13
WHAT ARE THE HYPOTHESES?

A manager stated that the average cost


per hat less than or equal to $20? In order
to test his claim, a data set was collected.
¢ State the question statistically: µ ≤ 20
¢ State the opposite statistically: µ > 20
¢ Select the alternative hypothesis: Ha: µ > 20
¢ State the null hypothesis: H0: µ ≤ 20

7 - 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

7 - 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?

7 - 16
POSSIBLE CONCLUSIONS OF
A HYPOTHESIS TEST

¢2 possible conclusions:
• Do not reject H0: The test is not significant
• Reject H0: The test is significant

¢Question: In the jury trial example, what are the possible


conclusions?

7 - 17
POSSIBLE ERRORS IN TESTING

• Type I error: Reject H0 if H0 is true


• Type II error: Do not reject H0 if H0 is false

¢ Question: Identify Type I and Type II errors in


the jury trial example.

7 - 18
POSSIBLE ERRORS IN TESTING

• Probability of type I error: alpha


— Significance level
• Probability of type II error: beta

7 - 19
JURY TRIAL RESULTS

H0: Innocent
Jury Trial H0 Test
Actual Situation Actual Situation
Verdict Innocent Guilty Decision H0 True H0
False

Accept Type II
Innocent Correct Error 1-a
H0 Error
(b)
Type I
Guilty Error Correct Reject 1-b
H0 Error (a)

7 - 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.

7 - 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)

7 - 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?

7 - 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.
7 - 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 H0. Otherwise, we do not reject H0.

7 - 25
ONE POPULATION TESTS

One
population

Mean Proportion

Z test T test Z test

7 - 26
ONE-TAILED Z TEST FOR MEAN (s 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
𝑋' − 𝜇"! 𝑋' − 𝜇
𝑧= = 𝜎
𝜎"!
𝑛

7 - 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
7 - 28 reject!
ONE-TAILED Z TEST
FINDING CRITICAL Z

To make rejection decision, we need to find out


! to Z makes this
critical value. Converting from 𝑿
process easier.
What Is Za given a = .025?

s=1
a = .025

0 Z
7 - 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 s to
be 15 grams. Test at the
.05 level. Assume normal
population. 368 gm.

7 - 30
RIGHT-TAILED Z TEST
SOLUTION

• Test Statistic:
¢ H0: 𝝁= 368
Ha: 𝝁> 368
¢ Checking assumptions:

• Decision:
¢ Rejection
rule/regions:
𝜶 = .05, n = 25 • Conclusion:

7 - 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?

7 - 32
WRITING CONCLUSIONS

¢2cases:
•Reject H0:

•Do not reject H0:

7 - 33
TWO-TAILED Z TEST
FOR MEAN (s 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:
𝑋' − 𝜇"! 𝑋' − 𝜇
𝑧= = 𝜎
𝜎"!
𝑛

7 - 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 s to
be 15 grams. Test at the
.05 level. Assume normal
368 gm.
population.

7 - 35
TWO-TAILED Z TEST
SOLUTION

¢ H0: 𝝁 = 368 • Test Statistic:


Ha: 𝝁 ≠368
¢ Checking assumptions

¢ Rejection rule/regions: • Decision:


𝜶 = 𝟎. 𝟎𝟓
Critical Value(s):
• Conclusion:

7 - 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-b)

7 - 37
CONCLUSION

1. Distinguish Types of Hypotheses


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

7 - 38

You might also like