Download Z - El Camino College

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Bootstrapping (statistics) wikipedia , lookup

History of statistics wikipedia , lookup

Foundations of statistics wikipedia , lookup

Psychometrics wikipedia , lookup

Statistical hypothesis testing wikipedia , lookup

Omnibus test wikipedia , lookup

Misuse of statistics wikipedia , lookup

Student's t-test wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Transcript
+
Discovering Statistics
2nd Edition Daniel T. Larose
Chapter 9:
Hypothesis Testing
Lecture PowerPoint Slides
+ Chapter 9 Overview
2
 9.1
Introduction to Hypothesis Testing
 9.2
z Test for the Population Mean: Critical-Value Method
 9.3
z Test for the Population Mean: p-Value Method
 9.4
t Test for the Population Mean µ
 9.5
z Test for the Population Proportion p
 9.6
Chi-Square Test for the Population Standard Deviation σ
 9.7
Probability of Type II Error and the Power of the
Hypothesis Test
+ 9.1: Introduction to Hypothesis
Testing
Objectives:
Construct the null hypothesis and the alternative
hypothesis from the statement of the problem.

State the two types of errors made in hypothesis
tests:

the Type I error, made with probability α
the Type II error, made with probability β
3
4
Constructing the Hypotheses
The basic idea of hypothesis testing is the following:
1. We need to make a decision about the value of a population parameter.
2. Unfortunately, the true value of that parameter is unknown.
3. Therefore, there may be different hypotheses about the true value.
The Hypotheses
•The status quo hypothesis represents what has been tentatively assumed
about the value of the parameter and is called the null hypothesis,
denoted as H0.
•The alternative hypothesis, or research hypothesis, denoted as Ha
represents an alternative claim about the value of the parameter.
5
Converting Words to Hypotheses
To convert a word problem into two hypotheses, look for key words that can
be expressed mathematically.
Strategy for Constructing Hypotheses About µ
1. Search the word problem for key words and select the associated symbol.
2. Determine the form of the hypotheses that uses this symbol.
3. Find the value of µ0 and write your hypotheses in the appropriate form.
6
Statistical Significance
In a hypothesis test, we compare the sample mean with the value µ0 of the
population mean used in the H0 hypothesis.
•If the difference is large, then H0 is rejected.
•If the difference is not large, then H0 is not rejected.
Statistical Significance
A result is said to be statistically significant if it is unlikely to have occurred
due to chance.
Note, the decision to reject or not reject H0 does not prove anything. Because
we rely on chance, there are two ways to render an incorrect decision.
7
Type I and Type II Errors
In a criminal trial, the defendant is innocent until proven guilty. The jury must
evaluate the truth of two competing hypotheses:
H0: defendant is not guilty
versus Ha: defendant is guilty
In statistics, the two incorrect decisions are called Type I and Type II errors.
Two Types of Errors
•Type I error: To reject H0 when H0 is true.
•Type II error: To not reject H0 when H0 is false.
8
Type I and Type II Errors
We can make decisions about population parameters using the limited
information available in a sample because we base our decisions on
probability.
•When the difference between the sample mean and the hypothesized mean
is large, then the null hypothesis is probably not correct.
• When the difference is small, then the data are probably consistent with the
null hypothesis.
But we don’t know for sure.
The probability of a Type I error is denoted as α(alpha). We set the
value of α to be some small constant, such as 0.01, 0.05, or 0.10, so
that there is only a small probability of rejecting a true null hypothesis.
The level of significance of a hypothesis test is another name for α.
The probability of a Type II error is denoted as β(beta). This is the
probability of not rejecting the null hypothesis when it is false.
+ 9.2: z Test for the Population
Mean: Critical-Value Method
Objectives:
Explain the essential idea about hypothesis testing
for the population mean.

Perform the z test for the mean using the critical
value method.

9
10
Hypotheses Testing for the Mean
In Section 9.1, we learned that a large difference between the observed
sample mean and the hypothesized mean would result in the rejection of
the null hypothesis. The question is, “How large is large?”
We must choose from one of the following two scenarios:
1. H0 is true, the value of µ0 is accurate, and our observation of this
extreme value of x-bar is an amazingly unlikely event.
2. H0 is not correct, and the true value of µ is closer to x-bar.
The Essential Idea About Hypothesis Testing for the Mean
When the observed value of the sample mean is unusual or extreme in the
sampling distribution that assumes H0 is true, we should reject H0.
Otherwise, we should not reject H0.
11
The Z Test Statistic
The Z statistic contains four quantities, three of which are taken from the
data. The sample mean and sample size are characteristics of the sample
data, and the population standard deviation represents the population
data.
The Test Statistic Zdata
The test statistic used for the Z test for the mean is:
Z data 
x  µ0

n
Z is an example of a test statistic, a statistic generated from a data set for
the purposes of testing a statistical hypothesis.
12
The Critical-Value Method
In the critical-value method for the Z test, we compare Zdata with a
threshold value, or critical value of Z, called Zcrit. This value separates Z
into two regions:
•Critical region: the values of Zdata for which we reject H0.
•Noncritical region: the values of Zdata for which we do not reject H0.
The value of Z that separates the critical region from the noncritical region
is called the critical value Zcrit.
H 0 : μ = μ0
Ha: μ > μ0
H 0 : μ = μ0
Ha: μ < μ0
H 0 : μ = μ0
Ha: μ ≠ μ0
13
The Critical-Value Method
Table of Critical Values for Common Levels of Significance
H 0 : μ = μ0
Ha: μ > μ0
H 0 : μ = μ0
Ha: μ < μ0
α = 0.10
Zcrit = 1.28
Zcrit = -1.28
Zcrit = 1.645
α = 0.05
Zcrit = 1.645
Zcrit = -1.645
Zcrit = 1.96
α = 0.01
Zcrit = 2.33
Zcrit = -2.33
Zcrit = 2.58
Reject if
Zdata ≥ Zcrit
Zdata ≤ Zcrit
Zdata ≤ -Zcrit or
Zdata ≥ Zcrit
H 0 : μ = μ0
Ha: μ ≠ μ0
14
Z Test for µ: Critical-Value Method
Z Test for the Population Mean µ: Critical-Value Method
When a random sample of size n is taken from a population where the
population standard deviation σ is known, you can use the Z test if (a) the
population is normal, or (b) the sample size is large (n ≥ 30).
Step 1: State the hypotheses.
Step 2: Find Zcrit and state the rejection rule.
Step 3: Calculate Zdata:
Z data 
x  µ0

n
Step 4: State the conclusion and the interpretation.
If Zdata falls in the critical region, then reject H0, otherwise do not reject H0.
+ 9.3: Z Test for the Population
Mean: p-Value Method
Objectives:
Carry out the Z test for the mean, using the p-value
method.

 Assess
the strength of evidence against the null
hypothesis.
Describe the relationship between the p-value
method and the critical-value method.

Use the Z confidence interval for the mean to
perform the two-tailed Z test for the mean.

15
16
The p-Value
In this section, we introduce the p-value method, which works by
comparing one probability (the p-value) to another probability (α). The pvalue is a measure of how well (or how poorly) the data fit the null
hypothesis.
p-Value
The p-value is the probability of observing a sample statistic at least as
extreme as the statistic observed, if we assume that the null hypothesis is
true.
The method for calculating p-values depends on the form of the
hypothesis test:
• When the p-value is in the right (upper) tail, we have a right-tailed test.
• When the p-value is in the left (lower) tail, we have a left-tailed test.
• When the p-value lies in both tails, we have a two-tailed test.
17
The p-Value
18
The p-Value
Since a p-value is based on the value of Zdata, it tells us whether or not
Zdata is an extreme value. Unusual and extreme values of the sample
mean, and therefore of Zdata will have a small p-value.
Assuming H0 is true:
Unusual and extreme values of sample mean and Zdata
•Small p-value (close to 0)
Values of sample mean and Zdata near center
•Large p-value (greater than, say, 0.15)
The rejection rule for performing a hypothesis test using the p-value
method is:
•Reject H0 when the p-value ≤ α.
•Otherwise, do not reject H0.
19
Z Test for µ: p-Value Method
Z Test for the Population Mean µ: p-Value Method
When a random sample of size n is taken from a population where the
population standard deviation σ is known, you can use the Z test if (a) the
population is normal, or (b) the sample size is large (n ≥ 30).
Step 1: State the hypotheses.
Step 2: Calculate Zdata:
Z data 
x  µ0

n
Step 3: Find the p-value using technology or a table.
Step 4: State the conclusion and the interpretation.
If the p-value ≤ α, then reject H0. Otherwise do not reject H0.
Assessing the Strength of
Evidence Against the Null
Hypothesis
The hypothesis testing methods we have seen deliver a simple yes-orno conclusion to reject or not reject H0. The p-value itself implicitly
represents the strength of evidence against the null hypothesis.
20
Relationship Between p-Value
Method and Critical-Value Method
21
Confidence Intervals and
Two-Tailed Hypothesis Tests
Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval
•If a certain value for µ0 lies outside the corresponding 100(1 – α)%Z
confidence interval for µ, then the null hypothesis specifying this value for
µ0 would be rejected for level of significance α.
• Alternatively, if a certain value for µ0 lies inside the corresponding 100(1
– α)%Z confidence interval for µ, then the null hypothesis specifying this
value for µ0 would not be rejected for level of significance α.
22
+ 9.4: t Test for the Population
Mean
Objectives:
Perform the t test for the mean using the criticalvalue method.

Carry out the t test for the mean using the p-value
method.

Use confidence intervals to perform two-tailed
hypothesis tests.

23
24
t Test for µ: Critical-Value Method
In many real-world scenarios, the value of the population standard
deviation σ is unknown. When this occurs, we should use neither the Z
interval or the Z test.
The test statistic used for the t test for the mean is:
tdata 
x  µ0
s
n
tdata represents the number of standard errors above or below µ0.
Because there is a different t curve for every different sample size, you
need to know the following in order to find the value of tdata.
•The form of the hypothesis test (one-tailed or two-tailed)
• The degrees of freedom (df = n –1)
• The level of significance α
25
t Test for µ: Critical-Value Method
t Test for the Population Mean µ: Critical-Value Method
When a random sample of size n is taken from a population, you can use
the t test if either the population is normal, or the sample size is large (n ≥
30).
Step 1: State the hypotheses.
Step 2: Find tcrit and state the rejection rule.
Step 3: Calculate tdata:
tdata 
x  µ0
s
n
Step 4: State the conclusion and the interpretation.
If tdata falls in the critical region, then reject H0, otherwise do not reject H0.
26
t Test for µ: Critical-Value Method
27
t Test for µ: p-Value Method
t Test for the Population Mean µ: p-Value Method
When a random sample of size n is taken from a population, you can use
the t test if either the population is normal or the sample size is large (n ≥
30).
Step 1: State the hypotheses and the rejection rule.
Step 2: Calculate tdata:
tdata 
x  µ0
s
n
Step 3: Find the p-value with technology or a table.
Step 4: State the conclusion and the interpretation.
If the p-value ≤ α, then reject H0. Otherwise do not reject H0.
28
t Test for µ: p-Value Method
Using Confidence Intervals to
Perform Two-Tailed t Tests
Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval
•If a certain value for µ0 lies outside the corresponding 100(1 – α)%t
confidence interval for µ, then the null hypothesis specifying this value for
µ0 would be rejected for level of significance α.
•Alternatively, if a certain value for µ0 lies inside the corresponding 100(1 –
α)%t confidence interval for µ, then the null hypothesis specifying this
value for µ0 would not be rejected for level of significance α.
29
+ 9.5: Z Test for the Population
Proportion
Objectives:
Perform the Z test for p using the critical-value
method.


Carry out the Z test for p using the p-value method.
Use confidence intervals for p to perform two-tailed
hypothesis tests about p.

30
31
Z Test for p: Critical-Value Method
So far, we have dealt with testing hypotheses about the population mean µ
only. In this section, we learn how to perform the Z test for the population
proportion p.
For our point estimate of the unknown parameter p, we use the sample
proportion p-hat:
pˆ  x , where x equals the number of successes.
n
The Essential Idea About Hypothesis Testing for the Proportion
When the sample proportion p-hat is unusual or extreme in the sampling
distribution that assumes H0 is correct, we should reject H0. Otherwise,
there is insufficient evidence against H0 and we should not reject H0.
32
The Critical-Value Method
Table of Critical Values for Common Levels of Significance
H0: p = p0
Ha: p > p0
H0: p = p0
Ha: p < p0
α = 0.10
Zcrit = 1.28
Zcrit = -1.28
Zcrit = 1.645
α = 0.05
Zcrit = 1.645
Zcrit = -1.645
Zcrit = 1.96
α = 0.01
Zcrit = 2.33
Zcrit = -2.33
Zcrit = 2.58
Reject if
Zdata ≥ Zcrit
Zdata ≤ Zcrit
Zdata ≤ -Zcrit or
Zdata ≥ Zcrit
H 0 : p = p0
Ha: p ≠ p0
33
Z Test for p: Critical-Value Method
Z Test for the Population Proportion p: Critical-Value Method
When a random sample of size n is taken from a population, you can use
the Z test for the proportion if both the normality conditions are satisfied:
np0 ≥ 5 and n(1 – p0) ≥ 5
Step 1: State the hypotheses.
Step 2: Find Zcrit and state the rejection rule.
Step 3: Calculate Zdata:
pˆ  p0
pˆ  p0
Z data 
 pˆ

p0 (1  p0 )
n
Step 4: State the conclusion and the interpretation.
If Zdata falls in the critical region, then reject H0, otherwise do not reject H0.
34
Z Test for p: p-Value Method
The p-value method for the z test for p is equivalent to the critical-value
method. The p-values are defined similarly to those for the z test for µ.
Z Test for the Population Proportion p: p-Value Method
When a random sample of size n is taken from a population, you can use
the Z test for the proportion if both the normality conditions are satisfied:
np0 ≥ 5 and n(1 – p0) ≥ 5
Step 1: State the hypotheses.
pˆ  p0
Step 2: Calculate Zdata:
Z data 
 pˆ

pˆ  p0
p0 (1  p0 )
n
Step 3: Find the p-value with technology or a table.
Step 4: State the conclusion and the interpretation.
If the p-value ≤ α, then reject H0. Otherwise do not reject H0.
Using Confidence Intervals to
Perform Two-Tailed z Tests
Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval
•If a certain value for p0 lies outside the corresponding 100(1 – α)%Z
confidence interval for p, then the null hypothesis specifying this value for
p0 would be rejected for level of significance α.
•Alternatively, if a certain value for p0 lies inside the corresponding 100(1 –
α)%Z confidence interval for p, then the null hypothesis specifying this
value for p0 would not be rejected for level of significance α.
35
χ2
+ 9.6:
(Chi-Square) Test for the
Population Standard Deviation
Objectives:
Perform the χ2 test for σ using the critical-value
method.


Carry out the χ2 test for σ using the p-value method.
Use confidence intervals for σ to perform two-tailed
hypothesis tests about σ.

36
χ2 Test for σ: Critical-Value
Method
37
In Section 8.4, we used the χ2 distribution to help us construct confidence
intervals for the population variance and standard deviation. Here we will
use the χ2 distribution to perform hypothesis tests about the population
standard deviation.
Under the assumption that H0 is true, the χ2 statistic takes the form:
2
 data

(n  1) s 2
 02
The Essential Idea About Hypothesis Testing for the Standard Deviation
When the observed value of χ2 is unusual or extreme on the assumption that
H0 is true, we should reject H0. Otherwise, there is insufficient evidence against
H0 and we should not reject H0.
χ2 Test for σ: Critical-Value
Method
χ2 Test for σ: Critical-Value Method
This hypothesis test is valid only if we have a random sample from a
normal population.
Step 1: State the hypotheses.
Step 2: Find χ2 critical value or values and state the rejection rule.
Step 3: Calculate χ2data:
2

2
data

(n  1) s
 02
which follows a χ2 distribution with n – 1 degrees of freedom, and where s2
represents the sample variance.
Step 4: State the conclusion and the interpretation.
If χ2data falls in the critical region, then reject H0, otherwise do not reject H0.
38
χ2 Test for σ: Critical-Value
Method
39
χ2 Test for σ: p-Value Method
χ2 Test for σ: p-Value Method
This hypothesis test is valid only if we have a random sample from a
normal population.
Step 1: State the hypotheses.
Step 2: Calculate χ2data:

2
data

(n  1) s 2
 02
which follows a χ2 distribution with n – 1 degrees of freedom, and where s2
represents the sample variance.
Step 3: Find the p-value.
Step 4: State the conclusion and the interpretation.
If the p-value ≤ α, then reject H0. Otherwise do not reject H0.
40
χ2 Test for σ: p-Value Method
41
Using Confidence Intervals to
Perform Two-Tailed χ2 Tests
Equivalence of a Two-Tailed Hypothesis Test and Confidence Interval
• If a certain value for σ0 lies outside the corresponding 100(1 – α)%
confidence interval for σ, then the null hypothesis specifying this value
for σ0 would be rejected for level of significance α.
• Alternatively, if a certain value for σ0 lies inside the corresponding 100(1
– α)% confidence interval for σ, then the null hypothesis specifying
this value for σ0 would not be rejected for level of significance α.
42
+ 9.7: Probability of Type II Error
and The Power of a Hypothesis
Test
Objectives:
Calculate the probability of a Type II error for a Z test
for µ.


Compute the power of a Z test for µ.
43
β Probability of a Type II Error
Calculating β, the Probability of a Type II Error
Step 1:
Recall that Zcrit divides the critical region from the noncritical region. Let xbarcrit be the value of the sample mean associated with Zcrit.
Right - tailed
xcrit  µ0  Z crit 
Left - tailed
xcrit  µ0  Z crit 
Two - tailed
xcrit,lower  µ0  Z crit 
xcrit,upper  µ0  Z crit 

n

n

n

n
Here µ0 is the hypothesized value of the population mean, σ is the
population standard deviation, and n is the sample size.
44
β Probability of a Type II Error
Calculating β, the Probability of a Type II Error
Step 2:
Here µ0 represents a particular value for the population mean µ chosen
from the values indicated in the alternative hypothesis Ha. Draw a normal
curve centered at µa, with the value or values of x-barcrit from Step 1.
Step 3:
Calculate β for the particular µ0, chosen using the following table:
Form of test
β = probability of Type II Error
Right-tailed
The area under the normal curve drawn in Step 2 to
the left of x-barcrit.
Left-tailed
The area under the normal curve drawn in Step 2 to
the right of x-barcrit.
Two-tailed
The area under the normal curve drawn in Step 2
between x-barcrit,lower and x-barcrit,upper.
45
46
Power of a Hypothesis Test
It is a correct decision to reject the null hypothesis when the null
hypothesis is false. The probability of making this type of correct decision
is called the power of the test.
Power of a Hypothesis Test
The power of a hypothesis test is the probability of rejecting the null
hypothesis when the null hypothesis is false. Power is calculated as
power = 1 – β
+ Chapter 9 Overview
47
 9.1
Introduction to Hypothesis Testing
 9.2
z Test for the Population Mean: Critical-Value Method
 9.3
z Test for the Population Mean: p-Value Method
 9.4
t Test for the Population Mean µ
 9.5
z Test for the Population Proportion p
 9.6
Chi-Square Test for the Population Standard Deviation σ
 9.7
Probability of Type II Error and the Power of the
Hypothesis Test