Chapter 8 Packet
Chapter 8 Packet
Hypothesis Testing
o Two methods of statistical inference:
1. Estimating parameters through confidence intervals
2. Making decisions about parameters through hypothesis tests
o Hypothesis testing is a procedure that enables us to choose between two claims
when we have variability in our measurements
1. Based on particular terminology and a well-specified set of steps
2. Also based, however, on a lot of common sense
➢ Note: 𝒑𝟎 is the value of the population parameter assumed true under the
null hypothesis
Note: Please write your notes for examples in chapter 8 on a separate piece of binder
paper, as almost every example is very long.
Example 1 (Part 1): The statewide success rate in math for all of California’s community
colleges was just 54% in Fall 2010. Over the next decade, the Math Department at West
Valley College tried various methods to improve learning. In Fall 2020, a random sample of
200 WVC math students were surveyed. Of these students, 133 were successful in their
math class. Is the success rate in math for all students at WVC in Fall 2020 significantly
higher than the statewide success rate in math in Fall 2010? Identify the hypotheses using
both words and symbols.
Null hypothesis:
• Words: __________________________________________________________________________________ is
(population proportion, p)
_____________________________________________________________________________________.
(population parameter, which is assume true)
• Symbol:
Alternative hypothesis:
• Words: __________________________________________________________________________________ is
(population proportion, p)
_____________________________________________________________________________________.
(population parameter, which is assume true)
• Symbol:
Example 2 (Part 1): In 1994, 61% of parents of children in high school felt that these
students were not being taught enough math and science. A recent survey of 800 randomly
selected parents found that 465 felt their children in high school are not being taught
enough math and science. Do parents feel differently today than they did in 1994? Identify
the hypotheses using both words and symbols.
Is it numerical or categorical?
these students are _________ being taught enough math and science ____________
Null hypothesis:
• Words: The percentage of parents of children in high school who feel that these
students were not being taught enough math and science __________________ is
(population proportion, p)
• Symbol:
Alternative hypothesis:
• Words: The percentage of parents of children in high school who feel that these
students were not being taught enough math and science __________________ is
(population proportion, p)
• Symbol:
Example 3: Write out the null and alternative hypotheses for each scenario:
a) If a six-sided die is fair, a 4 should be rolled 1/6 of the time. You want to test that
the die is unfair.
b) The proportion of people who live after suffering a stroke is 0.85. A new treatment
is developed, and researcher’s want to see if the proportion has now increased.
c) Researchers want to decide if more than half of U.S. voters support repealing the
current U.S. health plan.
d) In 2009, 11% of the U.S. population had a MySpace account. You want to see if the
proportion has decreased since then.
If the variable is ______________________, then the template for hypothesis for one proportion is
Next Ingredient: Making Mistakes
Since the significance level is the probability of making a mistake (rejecting the null when
we shouldn’t), it should logically be small:
Example 1 (Part 2): The statewide success rate in math for all of California’s community
colleges was just 54% in Fall 2010. Over the next decade, the Math Department at West
Valley College tried various methods to improve learning. In Fall 2020, a random sample of
200 WVC math students were surveyed. Of these students, 133 were successful in their
math class. Is the success rate in math for all students at WVC in Fall 2020 significantly
higher than the statewide success rate in math in Fall 2010? Suppose we choose = 0.05 as
our significance level. Interpret the significance level in context.
Example 2 (Part 2): In 1994, 61% of parents of children in high school felt that these
students were not being taught enough math and science. A recent survey of 800 randomly
selected parents found that 465 felt their children in high school are not being taught
enough math and science. Do parents feel differently today than they did in 1994?
Suppose we choose = 0.10 as our significance level. Write a sentence that interprets
this significance level in context.
Recall: We assume the null hypothesis to be true throughout the testing procedure
Important: We cannot make the significance level arbitrarily small, because doing so
increases the probability that we will mistakenly fail to reject the null hypothesis and doing
so decreases the probability of correctly rejecting the null hypothesis.
Next Ingredient: The Test Statistic
o A test statistic compares our observed outcome in the sample with the outcome
the null hypothesis says we should see
o It tells us the evidence we have against the null hypothesis, by comparing the
real world to the null hypothesis world
o For testing a single proportion, our observed outcome is 𝒑 ̂ and we compare this to
𝑝0 , the value of p under the null
o Applying the Central Limit Theorem, if we have random data and large sample
size, the distribution of 𝒑
̂ is:
𝑝(1 − 𝑝)
𝑁 (𝑝, √ )
𝑛
o With the results of the CLT, we can then develop a test statistic for testing a single
population proportion
o To test a proportion, we use the one-proportion z-test statistic which compares
the sample outcome to what is assumed under the null (Notice how it is similar to
the z-score formula from section 3.2).
̂ −𝒑𝟎
𝒑
one-proportion z-test statistic =
√𝒑𝟎(1−𝒑𝟎)
𝑛
versus
𝑜𝑏𝑠𝑒𝑟𝑣𝑒𝑑−𝑐𝑒𝑛𝑡𝑒𝑟
z-score =
𝑠𝑝𝑟𝑒𝑎𝑑
How to compute the one Proportion z-Test and p-value using a TI-83/84 graphing
calculator:
1. Using a calculator Press STAT then choose TESTS (by using the right arrow on the
keypad), and choose option 5: 1-PropZTest by scrolling down through the lists of
tests or just hitting the number 5.
2. After choosing 5: 1-PropZTest then plug in the value of p0 from your null
hypothesis, the number of successes for x, the sample size for n, and finally select
the correct option for your alternative hypothesis (prop ≠p0, <p0, >p0) (to select one
scroll through the list and then hit enter for the one you want). To finish I
recommend you select Draw and hit enter, but the Calculate option will also work
but will not give you the extra visual.
3. Make a note of the z-Test Statistic the calculator gives you and the p-value. It may
be helpful to draw the normal curve with the appropriate shading.
Example 1 (Part 3): The statewide success rate in math for all of California’s community
colleges was just 54% in Fall 2010. Over the next decade, the Math Department at West
Valley College tried various methods to improve learning. In Fall 2020, a random sample of
200 WVC math students were surveyed. Of these students, 133 were successful in their
math class. Is the success rate in math for all students at WVC in Fall 2020 significantly
higher than the statewide success rate in math in Fall 2010? Suppose we choose = 0.05 as
our significance level. Find the one-proportion z-test statistic using a graphing
calculator. Does the test statistic provide evidence or no evidence to discredit the null?
Hypothesis:
o Number of successes:
o Sample size:
o Sample proportion:
Choose: p0
Answer: z = ,p=
Interpret:
o The observed proportion/sample statistic was __________ standard errors
____________________________________________________________________________________
Hypothesis:
o Number of successes:
o Sample size:
o Sample proportion:
Choose: p0
Answer: z = ,p=
Interpret:
o The observed proportion/sample statistic was __________ standard errors
____________________________________________________________________________________
▪ A positive value means the sample outcome was greater than what was
expected of the population
▪ A negative value means the sample outcome was less than what was
expected of the population
▪ If the z-test statistic is near ±𝟐 or more, then our sample data is unusual
(Notice how this is similar to how we used z-score to describe unusualness in
section 3.2)
o In other words, there is evidence the null hypothesis is discredited
▪ If the z-test statistic is closer to 0, then our sample data is not unusual
o In other words, there is no evidence to discredit the null hypothesis
Final Ingredient: The P-Value
o The null hypothesis tells us what to expect when we look at our sample data
o If we see something unexpected/unusual, then we should doubt the null hypothesis
o The p-value is a number that measures our “surprise” in our sample data if the
null was really true
What is p-value?
o The p-value is the probability of obtaining a test statistic as extreme or more
extreme than the one we observed assuming the null hypothesis is true
Interpret: “0.0195% is the probability that 133 of 200 students will be successful in their
(sample proportion)
math class at West Valley, or something more extreme, assuming
the 54% success rate in math at West Valley is true.
(the null hypothesis, in words)
o The outcome from the sample is _________________ (which we saw in Example 1, part 3)
Example 2 (Part 4): In 1994, 61% of parents of children in high school felt that these
students were not being taught enough math and science. A recent survey of 800 randomly
selected parents found that 465 felt their children in high school are not being taught
enough math and science. Do parents feel differently today than they did in 1994?
The p-value is 0.095. Interpret.
Interpret: “9.5% is the probability that 465 of 800 parents of children in high school feel
(sample proportion)
they are not taught enough math and science today, or something more extreme, assuming
61% of parents feel this way today is true.
(the null hypothesis, in words)
Note about MyStatLab study tools: For questions 8.1.15 and 8.1.21, if you decide to use
the MyStatLab study tools “Help me solve this” or “View an example”:
o Find the z-test statistic and p-value using the function 1-PropZTest on your graphing
calculator.
o Do not find the z-test statistic and p-value by hand (i.e. do not use the z-test statistic
formula). That is, ignore the study tool instructions for these three questions.
8.2: Hypothesis Testing in Four Steps
Main Ingredients
o Now that you know the essential ingredients of hypothesis testing (hypotheses,
minimizing mistakes, test statistic, and p-value), it’s time to learn the recipe
o The hypothesis testing procedure uses four steps that combine the ingredients
we’ve just studied into a useful, logical structure
Step 1: Hypothesize
o Recall:
o The null hypothesis is a statement of equality about the population parameter
o The alternative hypothesis is a statement about the same parameter, but contains
one of the symbols <, >, or
o For a test of a single population proportion, p, we have the following sets of
hypotheses:
H0: p = p0 H0: p = p0 H0: p = p0
Ha: p > p0 Ha: p < p0 Ha: p p0
➢ Recall: p0 is the value of the population proportion assumed to be true under the
null hypothesis
Example 1 (Part 1): A researcher believes that more than half of all people with Facebook
accounts are female. She takes a random sample of 312 people with Facebook accounts
and finds that 186 are female. Does the data support the researcher’s belief? Identify the
hypotheses.
Hypothesis:
o Verify the conditions for the test to be valid (note these are the same ones from the
CLT and confidence intervals). This assures normality.
1. Random sample
2. Large sample: np0 10 and n(1 – p0) 10
3. Large population: N 10n
Example 1 (Part 2): A researcher believes that more than half of all people with Facebook
accounts are female. She takes a random sample of 312 people with Facebook accounts
and finds that 186 are female. Does the data support the researcher’s belief? Check the
conditions for a valid hypothesis test.
Significance level:
1. Random sample?
2. Large sample?
What is p0?
i. np0
3. Large population?
There is definitely over _______________ _______________________________.
(10n) (population)
Since all three Central Limit Theorems were met, this means we have a normal distribution
(with mean = 0 and standard deviation= 1) for the z-test statistic, and therefore validates
the use of a hypothesis test.
Step 3: Compute to Compare
Example 1 (Part 3): A researcher believes that more than half of all people with Facebook
accounts are female. She takes a random sample of 312 people with Facebook accounts
and finds that 186 are female. Does the data support the researcher’s belief? Compute the
test statistic and p-value.
Choose: p0
Answer: z = ,p=
Note about MyStatLab study tools: For questions 8.2.37, 8.2.39, and 8.2.41, if you decide
to use the MyStatLab study tools “Help me solve this” or “View an example”:
o Find the z-test statistic and p-value using the function 1-PropZTest on your graphing
calculator.
o Do not find the z-test statistic and p-value by hand (i.e. do not use the z-test statistic
formula). That is, ignore the study tool instructions for these three questions.
Step 4: Interpret
o Use the p-value and significance level, ∝, to make a decision about your hypothesis
test and write a conclusion.
o Note: Always write the conclusion within the context of the problem and specific
alternative hypothesis, using plain English
o If the p-value > ∝,, then we “fail to reject” and that “we do not have evidence to
support 𝑯𝒂 ”
1. Hypothesis:
2. Significance level:
3. p-value:
4. Decision:
Conclusion:
In Summary: Hypothesis Testing
1. Hypothesize
➢ Identify H0 and Ha based on the research description
2. Prepare
➢ Report the level of significance, a
➢ Check the conditions for a valid test (See **note below if conditions fail)
3. Compute
➢ Report the calculator option
➢ Use the calculator to compute the test statistic and p-value
4. Interpret
➢ Make the decision to reject H0 or not
➢ State the conclusion in the context of the study
o If the conditions fail to be met for the hypothesis test, the z-test statistic will
not follow a Normal distribution when the null hypothesis is true
o This means we cannot find the p-value using the Normal curve (i.e. we cannot
use normalcdf or 1-PropZTest on the graphing calculator). However, other
approaches often exist
Note: Please write your notes for examples in chapter 8 on a separate piece of binder
paper, as almost every example is very long.
Example 2: It is said that 90% of all restaurants fail after one year. Is the proportion of
Chinese restaurants which fail after one year different than 90%? A random sample of 185
Chinese restaurants are tracked for their first few years. After one year, 160 had failed.
Test using a significance level of 0.10. Show all four steps of hypothesis testing.
1. Hypothesis:
2. Significance level:
1. Random sample?
2. Large sample?
i. np0
3. Large population?
There is definitely over _______________ _______________________________.
(10n) (population)
Choose: p0
Answer: z = ,p=
4. Decision:
Conclusion:
Example 3: In 2009, 11% of Americans had a MySpace account. You want to see if the
proportion of Americans who have a MySpace accounts is less today than compared to
2009. You randomly survey 500 people and find that 43 of them have a MySpace account.
Does the data show that the proportion of Americans today with a MySpace account has
decreased since 2009? Use a 0.05 significance level and show all four steps of hypothesis
testing.
1. Hypothesis:
2. Significance level:
1. Random sample?
2. Large sample?
i. np0
3. Large population?
There is definitely over _______________ _______________________________.
(10n) (population)
Choose: p0
Answer: z = ,p=
4. Decision:
Conclusion:
Controlling Mistakes – Power
o In addition to focusing on what can go wrong (i.e. the significance level, 𝛼), statisticians
will also focus on the power of a hypothesis test
o The Power of a Hypothesis Test is the probability of rejecting the null when the
alternative is true – that is, the chance of making the right decision!
o Statisticians always strive for a large power (dependent on the significance level,
sample size, and how wrong the null is), while simultaneously keeping the
significance level small
Example 4: Most people assume that the probability of getting heads or tails when flipping
a coin is 50/50. Some Stanford researchers however believe that it is actually more likely
to land on the same face as it started out on, with a probability of 51%. Let’s suppose you
do the experiment and you also get a sample statistic of 51% for the face you started on.
Assuming the conditions are met, test to see if your statistic is significantly larger than .5
with = .05 when the sample size is 700 flips versus 7000 flips. For both sample sizes, the
hypothesis is 𝐻0 : 𝑝 = 0.50, 𝐻𝑎 : 𝑝 > 0.50.
a) When sample size is 700 flips, the number of successes (i.e. times the coin land on the
face you started with) is 𝑛𝑝̂ = 700(0.51) = 357 faces and the p-value is 0.298 (from
1-PropZTest: 𝑝0 = 0.50, 𝑥 = 357, 𝑛 = 700, 𝑝 > 𝑝0 ).
Decision:
Conclusion:
b) When sample size is 7000 flips, the number of successes (i.e. times the coin land on
the face you started with) is 𝑛𝑝̂ = 7000(0.51) = 3570 faces and the p-value is 0.0471
(from 1-PropZTest: 𝑝0 = 0.50, 𝑥 = 3570, 𝑛 = 7000, 𝑝 > 𝑝0 ).
Decision:
Conclusion:
c) Compare your p-values and your conclusions for the different sample sizes.
a) Which method is more appropriate if you want to know the population percentage of
people who prefer Pepsi?
b) Which method is more appropriate if you want to know if more than 50% prefer Pepsi?
When do Confidence Intervals and Hypothesis Test give the same results?
o Even though they are designed to answer different questions, they are similar enough
that you can often use a CI to reach the same types of conclusions you would with a HT
(given that the HT is a two-sided test)
a) What is p?
b) Conduct a hypothesis test at the = .05 level of significance. (Assume CLT holds.)
Hypothesis:
Calculator:
Decision:
Conclusion:
c) Construct the corresponding 95% confidence interval to the hypothesis test with a 5%
significance level.
Calculator:
Confidence interval:
Main idea: Since the hypothesis test is two sided, the result for a 95% confidence
interval is the same as the result a hypothesis test with 5% significance level. That is,
the 50% from the hypothesis test falls with the confidence interval of (0.43, 0.63).
8.4: Comparing Proportions from Two Populations
Step 1: Hypothesize
o Recall:
o The null is a statement about past research or the status quo
o The alternative is a statement the researcher hopes to support
o For two proportions, the null hypothesis is 𝑯𝟎 : 𝒑𝟏 = 𝒑𝟐
o Note this is the same as 𝑯𝟎 : 𝒑𝟏 − 𝒑𝟐 = 𝟎
o There are three possibilities for the alternative hypothesis:
Left-tailed test Right-tailed test Two-tailed test
𝑯 𝒂 : 𝒑𝟏 < 𝒑𝟐 𝑯𝒂 : 𝒑𝟏 > 𝒑𝟐 𝑯𝒂 : 𝒑𝟏 ≠ 𝒑𝟐
o Template for Hypothesis for Two Proportion
Example 1 (Part 1): “Apnea of prematurity” occurs when premature babies have
shallow breathing or stop breathing for more than 20 seconds. Researchers assigned a
treatment group to receive caffeine therapy, while a control group received a placebo. Of
the 937 random infants given the therapy, 377 suffered from death or disability. The
placebo group had 932 random infants, and of these, 431 suffered from death or disability.
Does caffeine therapy lower the rate of death or disability?
a) What are the two comparison groups?
Group 1:
Group 2:
Note: Make sure to check 𝒑̂ with 𝒏𝟏 and 𝒏𝟐 . Do not check 𝑝̂1 with 𝑛1 and
̂2 with 𝑛2. We use the pooled sample proportion 𝑝̂ to check both samples are
𝑝
large enough since
➢ the standard error is more complicated than in the one-sample case
➢ the null hypothesis tells us that both populations have the same
population proportions (but we do not know the value of either
population proportion 𝒑𝟏 or 𝒑𝟐 )
➢ therefore, we must pool the two samples together to form an estimate
proportion when checking if the samples are large enough
Note: Do not check for large populations when performing a hypothesis test to
compare two populations.
Example 1 (Part 2): “Apnea of prematurity” occurs when premature babies have
shallow breathing or stop breathing for more than 20 seconds. Researchers assigned a
treatment group to receive caffeine therapy, while a control group received a placebo. Of
the 937 random infants given the therapy, 377 suffered from death or disability. The
placebo group had 932 random infants, and of these, 431 suffered from death or disability.
Does caffeine therapy lower the rate of death or disability?
a) Set a significance level.
1. Random?
2. Prestep:
Large samples:
i. n1 p̂
ii. n1 (1 − p̂)
iii. n2 p̂
iv. n2 (1 − p̂)
3. Independence:
o The p-value is again found using the Normal distribution – it is the probability of
being as extreme or more extreme than this z, assuming the null is true
Example 1 (Part 3): “Apnea of prematurity” occurs when premature babies have
shallow breathing or stop breathing for more than 20 seconds. Researchers assigned a
treatment group to receive caffeine therapy, while a control group received a placebo. Of
the 937 random infants given the therapy, 377 suffered from death or disability. The
placebo group had 932 random infants, and of these, 431 suffered from death or disability.
Does caffeine therapy lower the rate of death or disability? Identify the p-value from the
calculator.
2-PropZTest: x1
n1
x2
n2
“p1 p2”
Step 4: Interpret
o Make a decision
o If the p-value < , we reject the null hypothesis
o If the p-value > , we fail to reject the null hypothesis
o Write a conclusion
o Reject the null:
“There is significant evidence the alternative hypothesis is true”
o Fail to reject the null:
“There is not significant evidence the alternative is true”
➢ Note: Always write the conclusion within the context of the problem and
specific alternative hypothesis, using plain English
Example 1 (Part 4): “Apnea of prematurity” occurs when premature babies have
shallow breathing or stop breathing for more than 20 seconds. Researchers assigned a
treatment group to receive caffeine therapy, while a control group received a placebo. Of
the 937 random infants given the therapy, 377 suffered from death or disability. The
placebo group had 932 random infants, and of these, 431 suffered from death or disability.
Does caffeine therapy lower the rate of death or disability?
a) Compare the p-value to and make a decision.
1. Hypothesize
➢ Identify H0 and Ha based on the research description
2. Prepare
➢ Report the level of significance, a
➢ Check the conditions for a valid test
3. Compute
➢ Report the calculator option
➢ Use the calculator to compute the test statistic and p-value
4. Interpret
➢ Make the decision to reject H0 or not
➢ State the conclusion in the context of the study
Example 2: A random sample of 500 people were asked about their political affiliation and
their attitude toward government-sponsored mandatory testing of AIDS. The results were
as follows:
Favor Undecided Opposed Total
Democrat 135 80 65
Republican 95 60 65
Is there a difference in the proportions of Democrats and Republicans who are undecided
regarding mandatory testing for AIDS? Use = 0.05 and show all four steps of hypothesis
testing.
1) Group 1:
Group 2:
Hypothesis:
2) Significance level:
Condition:
1. Random?
2. Prestep:
Large samples:
i. n1 p̂
ii. n1 (1 − p̂)
iii. n2 p̂
iv. n2 (1 − p̂)
3. Independence:
3) 2-PropZTest: x1
n1
x2
n2
“p1 p2”
p=
4) Decision:
Conclusion: