AP ECON 2500 Session 8
AP ECON 2500 Session 8
Lee
Department of Economics York University
Session 8: Inferences Based on a Single Sample:
Reading: Ch 7
Content
1. The Elements of a Test of Hypothesis
2. Formulating Hypotheses and Setting Up the Rejection Region
3. Observed Significance Levels: p-Values
4. Test of Hypothesis about a Population Mean: Normal (z) Statistic
5. Test of Hypothesis about a Population Mean: Student’s t-Statistic
6. Large-Sample Test of Hypothesis about a Population Proportion
7. Test of Hypothesis about a Population Variance
8. Calculating Type II Error Probabilities: More about
Learning Objectives
1. Introduce the concept of a test of hypothesis
2. Provide a measure of reliability for the hypothesis test, called the significance level of the
test
3. Test a specific value of a population parameter (mean, proportion or variance) called a
test of hypothesis.
4. Show how to estimate the reliability of a test.
Page 1 of 32
7.1 The Elements of a Test of Hypothesis
What’s a Hypothesis?
• A statistical hypothesis is a statement about the numerical value of a population
parameter.
• I believe the mean GPA of this class is 3.5!
Null Hypothesis
• The null hypothesis, denoted H0, represents the hypothesis that will be accepted unless the
data provide convincing evidence that it is false. This usually represents the “status quo” or
some claim about the population parameter that the researcher wants to test.
Alternative Hypothesis
• The alternative (research) hypothesis, denoted Ha, represents the hypothesis that will be
accepted only if the data provide convincing evidence of its truth. This usually represents
the values of a population parameter for which the researcher wants to gather evidence to
support.
• Opposite of null hypothesis
• The hypothesis that will be accepted only if the data provide convincing evidence of its
truth
• Designated Ha
• Stated in one of the following forms.
𝐻𝑎 : 𝜇 ≠ (𝑠𝑜𝑚𝑒 𝑣𝑎𝑙𝑢𝑒)
𝐻𝑎 : 𝜇 < (𝑠𝑜𝑚𝑒 𝑣𝑎𝑙𝑢𝑒)
𝐻𝑎 : 𝜇 > (𝑠𝑜𝑚𝑒 𝑣𝑎𝑙𝑢𝑒)
Identifying Hypotheses
Example problem: Test that the population mean is not 3
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)
Page 2 of 32
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
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
Is the average cost per hat less than or equal to $20?
• State the question statistically: 𝜇 ≤12
• State the opposite statistically: 𝜇 >12
• Select the alternative hypothesis: Ha: 𝜇 >12
• State the null hypothesis: H0: 𝜇 = 12
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
Page 3 of 32
Test Statistic
• The test statistic is a sample statistic, computed from information provided in the sample,
that the researcher uses to decide between the null and alternative hypotheses.
• The sampling distribution of 𝑥̅ assuming µ = 2,400. the chance of observing 𝑥̅ more
than 1.645 standard deviations above 2,400 is only .05 – if in fact the true mean µ is
2,400.
Type I Error
• A Type I error occurs if the researcher rejects the null hypothesis in favor of the alternative
hypothesis when, in fact, H0 is true. The probability of committing a Type I error is denoted by
.
Rejection Region
• The rejection region of a statistical test is the set of possible values of the test statistic for
which the researcher will reject H0 in favor of Ha.
Type II Error
• A Type II error occurs if the researcher accepts the null hypothesis when, in fact, H0 is false.
The probability of committing a Type II error is denoted by .
Page 4 of 32
Conclusions and Consequences for a Test of Hypothesis
Page 5 of 32
hypothesis is true because we do not (in general) know the probability 𝛽 that our test
procedure will lead to an incorrect acceptance of H0 (Type II error).
Page 6 of 32
Two-Tailed Test
• A two-tailed test of hypothesis is one in which the alternative hypothesis does not specify
departure from H0 in a particular direction and is written with the symbol “ ≠.”
• Some key words that help you identify this nondirectional nature are:
Two-tailed (≠): “not equal to,” “differs from”
Rejection Regions corresponding to one- and two-tailed tests:
Page 7 of 32
Example 7.3
• The population mean is known to be 12 ounces.
• Sigma is known to be 5.15
• 100 observations were randomly selected, and 𝑥̅ = 10.5
𝐻0 : 𝜇 = 12 𝑣𝑠 𝐻𝑎 : 𝜇 ≠ 12
𝑥̅ − 𝜇 10.5−12
Test statistic; 𝑧 = = = −2.91
𝜎/√𝑛 5.15/√100
• Conclusion: Reject H0
Page 8 of 32
Summary:
Null Hypothesis, H0:
• States the claim or assertion to be tested
• Example: The average number of TV sets in Canadian Homes is equal to three (HO: µ=3)
• Is always about a population parameter, not about a sample statistic
H0 : μ = 3 H0 : X = 3
Is/are
• Begin with the assumption that the null hypothesis is true.
• Similar to the notion of innocent until proven guilty.
• The Null Hypothesis, H0
• Begin with the assumption that the null hypothesis is true
• Similar to the notion of innocent until
proven guilty
• Refers to the status quo or historical value
• Always contains “=” , “≤” or “≥” sign.
• May or may not be rejected.
Page 9 of 32
Example:
• Now we try to answer the following questions:
• From the sample mean of 372.5, can we say that (1) the population mean is equal to 368, or
(2) population mean is greater than 368, or (3) population mean is smaller than 368?
• Let’s start from the question (1) Can we say that the population mean is equal to 368 based
on the sample mean of 372.5?
• In statistics term, we say let’s test if the true population mean is 368 with α = 0.05.
X − 0 372.5 − 368
= = = 1.50
n 15 25
Rejection regions
0.025 0.025
Page 10 of 32
Example
• Does the job satisfaction of assembly-line workers differ when their work is machine-paced
rather than self-paced? A matched pairs study was performed on a sample of workers, and
each worker’s satisfaction was assessed after working in each setting. The response
variable is the difference in satisfaction scores, self-paced minus machine-paced.
• The null hypothesis is no average difference in scores in the population of assembly-line
workers, while the alternative hypothesis (the one we’d like to prove true) is that, on
average, there is a difference in scores in the population of assembly workers.
H0: 𝜇 = 0 Ha : 𝜇 ≠ 0
• This is a two-sided alternative because we are interested in determining if a difference,
positive or negative, exists.
• Suppose job satisfaction scores follow a Normal distribution with standard deviation 𝜎 = 60.
Data from 18 workers gave a sample mean score of 17. The test statistic is:
𝑥̅ − 𝜇0 17−0
𝑧= = ≈ 1.20
𝜎⁄√𝑛 60⁄√18
Area=0.1151 area=0.1151
-1.2 0 1.2
Page 11 of 32
7.3 Observed Significance Levels: p-Values:
p-Value
• The observed significance level, or p-value, for a specific statistical test is the probability
(assuming H0 is true) of observing a value of the test statistic that is at least as contradictory
to the null hypothesis, and supportive of the alternative hypothesis, as the actual one
computed from the sample data.
• Probability of obtaining a test statistic more extreme ( ≤ or ≥ ) than actual sample value,
given H0 is true
• Called observed level of significance:
- Smallest value of 𝛼 for which H0 can be rejected
• Used to make rejection decision
- If p-value ≥ 𝛼, do not reject H0
- If p-value < 𝛼, reject H0
Steps for Calculating the p-Value for a Test of Hypothesis
1. Determine the value of the test statistic z corresponding to the result of the sampling
experiment.
2. If the test is one-tailed, the p-value is equal to the tail area beyond z in the same direction
as the alternative hypothesis. Thus, if the alternative hypothesis is of the form >, the p-value is
the area to the right of, or above, the observed z-value. Conversely, if the alternative is of
the form <, the p-value is the area to the left of, or below, the observed z-value.
3. If the test is two-tailed, the p-value is equal to twice the tail area beyond the observed z-
value in the direction of the sign of z – that is, if z is positive, the p-value is twice the area to
Page 12 of 32
the right of, or above, the observed z-value. Conversely, if z is negative, the p-value is twice
the area to the left of, or below, the observed z-value.
Page 13 of 32
Example again: Two-Tailed z Test p-Value 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. Find the p-value.
How does it compare to = .05?
• H0: μ= 368 vs Ha: μ 368
• Z stat = 1.50
• Critical value: Z=+ 1.96 with α=0.05 ➔ do not reject H0.
Rejection regions
0.025 0.025
0.5*p-value = 0.0668
0.5*p-value
0.4332
-1.5 0 1.5
p-value= 0.0668*2 = 0.1336 > 0.05 = 𝜶 ➔ Do not reject Ho.
If the hypotheses are set as follows:
Ho: 368 vs Ha: 368 ➔ p-value = 0.0668
Page 14 of 32
Example SAT Math Scores, 𝑋̅ = 495, 𝑛 = 100, 𝜎 = 100
a. Construct 95% CI for μ.
b. Test if μ = 485
c. Test if μ ≥ 485
d. Test if μ ≤ 485
100
#a: 495 ± 1.96 ∗ = (475.40, 514.60)
√100
495−485
#b: 𝐻0 : 𝜇 = 485 𝑣𝑠 𝐻𝑎: 𝜇 ≠ 485, 𝑧𝑠𝑡𝑎𝑡 = 100⁄ = 2.24,
√100
𝑝 − 𝑣𝑎𝑙𝑢𝑒➔1 − 0.9875 = 0.0125, 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 2 ∗ 0.0125 = 0.025 ==> 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻𝑜 𝑖𝑓 𝛼 > 0.025
#c: 𝐻0 : 𝜇 = 485 𝑣𝑠 𝐻𝑎: 𝜇 > 485, 𝑧𝑠𝑡𝑎𝑡 = 2.24, 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.0125 ==> 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻𝑜 𝑖𝑓 𝛼 > 0.0125
#d: 𝐻0 : 𝜇 = 485 𝑣𝑠 𝐻𝑎: 𝜇 < 485, 𝑧𝑠𝑡𝑎𝑡 = 2.24, 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.9875 ==> 𝑑𝑜 𝑛𝑜𝑡 𝑟𝑒𝑗𝑒𝑐𝑡 𝑖𝑓 𝛼 < 0.9875
Test Statistic ̅− 𝝁𝟎
𝒙 ̅− 𝝁𝟎
𝒙
𝛔 𝐤𝐧𝐨𝐰𝐧 𝐳= ; 𝛔 𝐮𝐧𝐤𝐧𝐨𝐰𝐧 𝐳=
𝝈⁄√𝒏 𝒔⁄√𝒏
Rejection 𝒛𝒄 < −𝒛𝜶 (𝐨𝐫 𝒛𝒄 > 𝒛𝜶 ) 𝒛𝒄 < −𝒛𝜶/𝟐 (𝐨𝐫 𝒛𝒄 > 𝒛𝜶/𝟐
Region
p-value
Example
Does an average box of cereal contain 368 grams of cereal? A random sample of 25 boxes had
𝑥̅ = 372.5. The company has specified σ to be 25 grams. Test at the .05 level of significance.
H0: 𝛍 = 𝟑𝟔𝟖 𝒗𝒔 𝑯𝒂 : 𝝁 ≠ 𝟑𝟔𝟖 and n = 25
̅− 𝝁𝟎
𝒙 𝟑𝟕𝟐.𝟓− 𝟑𝟔𝟖
𝐳= = = 𝟎. 𝟗 ==> 𝐩 − 𝐯𝐚𝐥𝐮𝐞 ? (=0.368)
𝝈⁄√𝒏 𝟐𝟓⁄√𝟐𝟓
Page 15 of 32
Example: two-Tailed z Test
You’re a Q/C inspector. You want to find out if a new machine is making electrical cords to
customer specification: average breaking strength of 70 lb. with σ = 3.5 lb. You take a sample of
36 cords & compute a sample mean of 69.7 lb. At the .05 level of significance, is there evidence
that the machine is not meeting the average breaking strength?
H0: 𝛍 = 𝟕𝟎 𝒗𝒔 𝑯𝒂 : 𝝁 ≠ 𝟕𝟎 and n = 36
̅ − 𝝁𝟎
𝒙 𝟔𝟗. 𝟕 − 𝟕𝟎
𝐳= = = −𝟎. 𝟓𝟏 ==> 𝐩 − 𝐯𝐚𝐥𝐮𝐞 ?
𝝈⁄√𝒏 𝟑. 𝟓⁄√𝟑𝟔
̅ − 𝝁𝟎
𝒙 𝟑𝟎. 𝟕 − 𝟑𝟐
𝐳= = = −𝟐. 𝟔𝟓 ==> 𝐩 − 𝐯𝐚𝐥𝐮𝐞 ? = 𝟎. 𝟎𝟎𝟎𝟒
𝝈⁄√𝒏 𝟑. 𝟖⁄√𝟔𝟎
==> 𝐑𝐞𝐣𝐞𝐜𝐭 𝐇𝐨
Page 16 of 32
7.5 Test of Hypothesis about a Population Mean: Student’s t-Statistic
The t Distributions
• When the sampling distribution of 𝑋̅ is close to Normal, we can find probabilities involving 𝑋̅
by standardizing:
𝑋̅− 𝜇
• 𝑧=
𝜎⁄√𝑛
• When we don’t know σ, we can estimate it using the sample standard deviation sx. What
happens when we standardize?
𝑋̅− 𝜇
• ??= This new statistic does not have a Normal distribution!
𝑠𝑥 ⁄√𝑛
• When we standardize based on the sample standard deviation sx, our statistic has a new
distribution called a t distribution.
• The t distribution has a shape similar to that of the standard Normal curve in that it is
symmetric with a single peak at 0.
• However, it differs from the Normal curve in that has more area in the tails.
Page 17 of 32
• Like any standardized statistic, t tells us how far 𝑥̅ is from its mean 𝜇 in standard deviation
units.
• However, there is a different t distribution for each sample size, specified by its degrees of
freedom (df).
• When we perform inference about a population mean µ using a t distribution, the
appropriate degrees of freedom are found by subtracting 1 from the sample size n, making
df = n – 1.
• The t distributions have more probability in the tails and less in the center than does the
standard Normal.
• As the degrees of freedom increase, the t density curve becomes ever closer to the
standard Normal curve.
Page 18 of 32
• We can use Table D in the back of the book to determine critical values t* for t distributions
with different degrees of freedom.
The One-Sample t Confidence Interval for a Population Mean
• The one-sample t interval for a population mean is similar in both reasoning and
computational detail to the one-sample z interval for a population mean.
• Choose an SRS of size n from a population having unknown mean µ. A level C confidence
𝑠
interval for µ is: 𝑥̅ ± 𝑡 ×
√𝑛
where t* is the critical value for the t(n – 1) distribution.
𝑠
• The margin of error is: 𝑡 ×
√𝑛
• This interval is exact when the population distribution is Normal and approximately correct
for large n in other cases.
The One-Sample t Test
• Choose an SRS of size n from a large population that contains an unknown mean µ. To test
the hypothesis H0: µ = µ0, compute the one-sample t statistic:
𝑥̅ − 𝜇0
t=
𝑠𝑥 ⁄√𝑛
• Find the P-value by calculating the probability (at degrees of freedom = n – 1) of getting a t
statistic this large or larger in the direction specified by the alternative hypothesis Ha.
• These P-values are exact if the population distribution is Normal and are approximately
correct for large n in other cases.
Page 19 of 32
Example: One-Sample t Test
• Television watching reported an average of 18.5 hours for 18 to 24 year olds. We want to
test whether the average time that college students watch television differs from the
reported value of 18.5.
• We want to perform a test at the α = 0.05 significance level of
H0: µ = 18.5 vs Ha: µ ≠ 18.5
where µ is the actual mean hours of television watched by college students.
• The sample mean and standard deviation are 𝑥̅ = 14.5 hours and 𝑠𝑥 = 14.85 hours
𝑥̅ − 𝜇0 14.5 – 18.5
• Test statistic: t = = = −0.762
𝑠𝑥 ⁄√𝑛 14.85⁄√8
• The P-value is twice the area to the left of t = –0.76 under the t distribution curve with
df = 8 – 1 = 7.
• The P-value is between 2 x 0.20 = 0.40 and 2 x 0.25 = 0.50. Because this is greater than our α =
0.05 significance level, we fail to reject H0. We don’t have enough evidence to conclude
that the mean hour college students watch television differs from the Nielsen value of 18.5.
Example:
• The level of dissolved oxygen (DO) in a stream or river is an important indicator of the
water’s ability to support aquatic life. A researcher measures the DO level at 15 randomly
chosen locations along a stream. Here are the results in milligrams per liter:
4.53 5.04 3.29 5.23 4.13 5.50 4.83 4.40 5.42 6.38 4.01 4.66 2.87 5.73 5.55
Page 20 of 32
• A dissolved oxygen level below 5 mg/l puts aquatic life at risk.
• We want to perform a test at the 𝛼= 0.05 significance level of:
H0: µ = 5
Ha: µ < 5
where µ is the actual mean dissolved oxygen level in this stream.
• If conditions are met, we should do a one-sample t test for µ.
- Random: The researcher measured the DO level at 15 randomly chosen locations.
- Normal: We don’t know whether the population distribution of DO levels at all points
along the stream is Normal. With such a small sample size (n = 15), we need to look at
the data to see if it’s safe to use t procedures.
• The histogram looks roughly symmetric; the boxplot shows no outliers; and the Normal
probability plot is fairly linear. With no outliers or strong skewness, the t procedures should be
pretty accurate even if the population distribution isn’t exactly Normal.
• The sample mean and standard deviation are
𝑋̅ − 𝜇0 4.771 − 5
𝑇𝑒𝑠𝑡 𝑆𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 𝑡 = = = −0.94
𝑠𝑥 ⁄√𝑛 0.9396⁄√15
• P-value: The P-value is the area to the left of t = –0.94 under the t distribution curve with
df = 15 – 1 = 14.
• The P-value is between 0.15 and 0.20. Since this is greater than our = 0.05 significance
level, we fail to reject H0. We don’t have enough evidence to conclude that the mean DO
level in the stream is less than 5 mg/l.
Page 21 of 32
• Since we decided not to reject H0, we could have made a Type II error (failing to reject H0
when H0 is false). If we did, then the mean dissolved oxygen level µ in the stream is actually
less than 5 mg/l, but we didn’t detect that with our significance test.
Example:
• Suppose that Bell Canada announces that Canadian cellphone users average 5.4 hours
per month watching videos on their phones.
• You draw the following SRS of size 8 from this population.
11.9 2.8 3.0 6.2 4.7 9.8 11.1 7.8
• Test if the population mean of 5.4 is true
1. With 95% confidence interval
2. With the test of hypothesis.
𝑠 3.56
• 𝑥̅ = 7.16, 𝑠 = 3.56, 𝑠𝑡𝑎𝑛𝑑𝑎𝑟𝑑 𝑒𝑟𝑟𝑜𝑟 = = = 1.26, 𝑐𝑟𝑖𝑡𝑖𝑐𝑎𝑙 𝑣𝑎𝑙𝑢𝑒, 𝑡0.025,7 = ±2.365
√𝑛 √8
𝑠
• 95% CI: 𝑥̅ ± 𝑡 = 7.16 ± 2.365 × 1.26 = 7.16 ± 2.98 = (4.2, 10.1)
√𝑛
• Testing Hypothesis:
𝐻0 : 𝜇 = 5.4
𝐻𝑎 : 𝜇 ≠ 5.4
The t test statistic is:
𝑥̅ − 𝜇0 7.16 − 5.4
𝑡= = = 1.40
𝑠/√𝑛 3.56/√8
𝑃𝑣𝑎𝑙𝑢𝑒 = 2 × 𝑃(𝑇 ≥ 1.415) = 2 × 0.1 = 0.2
• From the both approaches, we do not reject Ho.
Page 22 of 32
7.6 Large-Sample Test of Hypothesis about a Population Proportion
𝑝̂ (1 − 𝑝̂ )
𝑝̂ ± 𝑧√
𝑛
Page 23 of 32
• If conditions are met, we should do a one-sample z test for the population proportion p.
- Random: The supervisor took a random sample of 500 potatoes from the shipment.
- Normal: Assuming H0: p = 0.08 is true, the expected numbers of blemished and
unblemished potatoes are np0 = 500(0.08) = 40 and n(1 – p0) = 500(0.92) = 460,
respectively. Because both of these values are at least 10, we should be safe doing
Normal calculations.
• The sample proportion of blemished potatoes is
47
𝑝̂ = = 0.094
500
𝑝̂ − 𝑝0 0.094 − 0.08
𝑡𝑒𝑠𝑡 𝑠𝑡𝑎𝑡𝑖𝑠𝑡𝑖𝑐 𝑧 = = = 1.15
√𝑝0 (1 − 𝑝0 ) √0.08(1 − 0.08)
𝑛 500
P-value: The desired P-value is: P(z ≥ 1.15) = 1 – 0.8749 = 0.1251. Since our P-value, 0.1251, is
greater than the chosen significance level of 𝛼 = 0.10, we fail to reject H0. There is not
sufficient evidence to conclude that the shipment contains more than 8% blemished
potatoes. The producer will use this truckload of potatoes to make potato chips
Example:
• A national survey by the National Institute for Occupational Safety and Health on restaurant
employees found that 75% said that work stress had a negative impact on their personal
lives.
• You investigate a restaurant chain to see if the proportion of all their employees negatively
affected by work stress differs from the national proportion p0 = 0.75.
H0: p = p0 = 0.75 vs. Ha: p ≠ 0.75 (2 sided alternative)
• In your SRS of 100 employees, you find that 68 answered “Yes” when asked, “Does work
stress have a negative impact on your personal life?”
• The expected counts are 100 × 0.75 = 75 and 25. Both are greater than 10, so we can use
the z-test.
• The test statistic is:
pˆ − p 0 0.68 − 0.75
z= = = −1.62
p 0 (1 − p 0 ) (0.75)(0.25)
n 100
Page 24 of 32
• From Table A we find the area to the left of z = -1.62 is 0.0526. Thus P(Z ≤ -1.62) = 0.0526.
Since the alternative hypothesis is two-sided, the P-value is the area in both tails, and
therefore the p-value = 2 × 0.0526 = 0.1052.
• The chain restaurant data are not significantly different from the national survey results
( p̂ = 0.68, z = -1.62, p-value = 0.11).
Rejection region: 𝑋 2 < 𝑋𝛼2 (𝑜𝑟 𝑋 2 > 𝑋𝛼2 𝑤ℎ𝑒𝑟𝑒 𝐻𝑎 : 𝜎2 > 𝜎20 )
where 𝜎02 is the hypothesized variance and the distribution of is based on (n – 1) degrees of freedom.
2 2
Rejection region: 𝑋 2 < 𝑋1−𝛼/2 𝑜𝑟 𝑋 2 > 𝑋𝛼/2 (n – 1) degrees of freedom.
Page 25 of 32
Conditions Required for a Valid Hypothesis Test for 𝜎 2
1. A random sample is selected from the target population.
2. The population from which the sample is selected has a distribution that is approximately
normal.
Several 2 probability Distributions
Page 26 of 32
Finding Critical Value Example
What is the critical X2 value given:
Ha: 𝜎 2 > 0.7 and n = 3, alpha = 0.05
df = n-1 = 2
Rejection (alpha = 0.05)
Example: Is the variation in boxes of cereal, measured by the variance, equal to 15 grams? A
random sample of 25 boxes had a standard deviation of 17.7 grams. Test at the .05 level of
significance.
𝐻0 : 𝜎 2 = 15 vs 𝐻𝑎 : 𝜎 2 ≠ 15
(𝑛−1)𝑠2 (25−1)17.72
Test statistic: 𝑋 2 = = = 33.42
𝜎02 15
Page 27 of 32
7.8 Calculating Type II Error Probabilities: More about 𝛃
Power
• When we draw a conclusion from a significance test, we hope our conclusion will be correct.
But sometimes it will be wrong. There are two types of mistakes we can make.
• Risk of Decision Making under Hypothesis Testing:
• Type I error: probability of rejecting Ho when Ho is true (=𝛼).
• Type II error: probability of not rejecting Ho when Ho is not true.
• The level of significance = 𝜶: The probability of committing a Type I error.
• The confidence level = (1- 𝜶) *100: the probability of not rejecting Ho when it is true.
◼ The confidence coefficient (1-𝛼) is the probability of not rejecting H0 when it is true.
◼ The confidence level of a hypothesis test is (1-𝛼)*100%.
◼ The power of a statistical test (1-β) is the probability of rejecting H0 when it is false.
Page 28 of 32
Type I & II Error Relationship
▪ Type I and Type II errors cannot happen at the same time
▪ A Type I error can only occur if H0 is true
▪ A Type II error can only occur if H0 is false
▪ If Type I error probability ( ) UP , then Type II error probability ( β ) DOWN
Power of Test:
• The power of a test against a specific alternative is the probability that the test will reject H0 at
a chosen significance level when the specified alternative value of the parameter is true.
Example:
• A potato-chip producer wonders whether the significance test of H0: p = 0.08 versus Ha: p >
0.08 based on a random sample of 500 potatoes has enough power to detect a shipment
with, say, 11% blemished potatoes.
• What if p = 0.11?
• The power of a test against any alternative is 1 minus the probability of a Type II error for that
alternative; that is, power = 1 – β.
• Since we reject H0 at = 0.05 if our sample yields a proportion > 0.0999, we’d correctly reject
the shipment about 75% of the time.
The Common Practice of Testing Hypotheses
1. State H0 and Ha as in a test of significance.
2. Think of the problem as a decision problem, so the probabilities of Type I and Type II errors
are relevant.
3. Consider only tests in which the probability of a Type I error is no greater than .
4. Among these tests, select a test that makes the probability of a Type II error as small as
possible.
Page 29 of 32
Example: σ = 2, n = 25, α = 0.05, 𝐻0 : 𝜇 = 0 𝑣𝑠 𝐻𝑎 : 𝜇 > 0, 𝑃𝑜𝑤𝑒𝑟? 𝑓𝑜𝑟 𝜇 = 1
𝑋̅ − 0 0.658 − 1
z = 1.645 = ==> 𝑋̅ = 0.658 ==> 𝑧 = = −0.855
2⁄√25 2⁄√25
σ=2
power = 1 − β = 0.8038
β = 0.1962 α == 0.05
power = 1 − β = 0.8159
Page 30 of 32
Review:
#7.8 Find alphas for the followings:
a. z > 1.96,
b. z > 1.645,
c. z > 2.576
d. z < -1.282
#7.22 Test if μ is greater than 50. n = 100, 𝑥̅ = 49.4, 𝑠 = 4.1
49.4 − 50
𝐻0 : 𝜇 = 50 𝑣𝑠 𝐻𝑎 : 𝜇 > 50 , 𝑧𝑠𝑡𝑎𝑡 = = −1.46 ==> 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.9279 ==> 𝑑𝑜 𝑛𝑜𝑡 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 .
4.1/√100
49.4 − 50
𝐻0 : 𝜇 = 50 𝑣𝑠 𝐻𝑎 : 𝜇 < 50 , 𝑧𝑠𝑡𝑎𝑡 = = −1.46 ==> 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.0721 ==> 𝑑𝑜 𝑛𝑜𝑡 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 .
4.1/√100
49.4 − 50
𝐻0 : 𝜇 = 50 𝑣𝑠 𝐻𝑎 : 𝜇 ≠ 50 , 𝑧𝑠𝑡𝑎𝑡 = = −1.46 ==> 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.1442 ==> 𝑑𝑜 𝑛𝑜𝑡 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 .
4.1/√100
#7.28 Test if μ is greater than 70. n = 400, 𝑥̅ = 72.5, 𝜎 = 20
72.5 − 70
𝐻0 : 𝜇 = 70 𝑣𝑠 𝐻𝑎 : 𝜇 > 70 , 𝑧𝑠𝑡𝑎𝑡 = = 2.5 ==> 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.0062 ==> 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 .
20/√400
#7.50 Test if μ is 6. n = 5, 𝑥̅ = 4.8, 𝑠 = 1.3
4.8 − 6
𝐻0 : 𝜇 = 6 𝑣𝑠 𝐻𝑎 : 𝜇 ≠ 6 , 𝑡𝑠𝑡𝑎𝑡 = = −2.064 ==> 𝑑𝑓 = 5, 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.107 ==> 𝑑𝑜 𝑛𝑜𝑡 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 .
1.3
√5
#7.52
Data: 30 10 9 10 5 10 ; Test if μ is greater than 5. n = 6, 𝑥̅ = 12.33, 𝑠 = 8.87
12.33 − 5
𝐻0 : 𝜇 = 5 𝑣𝑠 𝐻𝑎 : 𝜇 > 5 , 𝑡𝑠𝑡𝑎𝑡 = = 2.03 ==> 𝑑𝑓 = 5, 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.049
8.87
√6
==> 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻0 𝑤ℎ𝑒𝑛 𝛼 = 0.05.
#7.64 n = 100, 𝑝̂ = 0.63, 𝑡𝑒𝑠𝑡 𝑖𝑓 𝑝 = 0.7
0.63 − 0.7
𝐻0 : 𝑝 = 0.7 𝑣𝑠 𝐻𝑎 : 𝑝 < 0.7 , 𝑧𝑠𝑡𝑎𝑡 = = −1.53 ==> 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.063
√0.7(1 − 0.7)
100
#7.65 n = 100, 𝑝̂ = 0.83, 𝑡𝑒𝑠𝑡 𝑖𝑓 𝑝 = 0.9
0.83 − 0.9
𝐻0 : 𝑝 = 0.9 𝑣𝑠 𝐻𝑎 : 𝑝 < 0.9 , 𝑧𝑠𝑡𝑎𝑡 = = −2.33 ==> 𝑝 − 𝑣𝑎𝑙𝑢𝑒 = 0.0098
√0.9(1 − 0.9)
100
Page 31 of 32
#7.84 n = 7, 𝑥̅ = 9.4, 𝑠 2 = 4.84 𝑡𝑒𝑠𝑡 𝑖𝑓 𝜎 2 = 1 𝑣𝑠 𝜎 2 > 1
(𝑛 − 1)𝑠 2 (7 − 1)(4.84)
𝐻0 : 𝜎 2 = 1 𝑣𝑠 𝐻𝑎 : 𝜎 2 > 1 , 𝐹𝑠𝑡𝑎𝑡 = = = 29.04
𝜎02 1
2
𝑑𝑓 = 7 − 1 = 6, 𝑋0.05 = 12.59 ===> 𝑟𝑒𝑗𝑒𝑐𝑡 𝐻𝑜
#7.97
For testing 𝐻0 : 𝜇 = 500 𝑣𝑠 𝐻𝑎 : 𝜇 > 500 𝑤𝑖𝑡ℎ 𝛼 = 0.05, 𝑎𝑛𝑑 𝜎 = 100, 𝑛 = 25
Compute the power of test for 𝐻𝑎 : 𝜇 = 550
power = 1 − β
β
𝛼 = 0.05
500 550
𝛼 = 0.05
0 1.645
Page 32 of 32