Introduction to Statistics for Data Science
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
1INF 1344H
Introduction to Statistics for Data Science
Hypothesis Test, & t-Test of Sample Mean
The Reasoning of Hypothesis Testing (1 of 8)
• There are four basic parts to a hypothesis test:
1. Hypotheses
2. Model
3. Mechanics
4. Conclusion
• Let’s look at each part in detail…
5INF 1344H
Introduction to Statistics for Data Science
Lecture 9
Hypothesis Test, & t-Test of Sample Mean
The Reasoning of Hypothesis Testing (2 of 8)
1. Hypotheses
– The null hypothesis: To perform a hypothesis test, we must
first translate our question of interest into a statement about
model parameters
§ In general, we have
– The alternative hypothesis: The alternative hypothesis, HA,
contains the values of the parameter we consider plausible
when we reject the null
6INF 1344H
Introduction to Statistics for Data Science
Lecture 9
Hypothesis Test, & t-Test of Sample Mean
The Reasoning of Hypothesis Testing (3 of 8)
2. Model
– To plan a statistical hypothesis test, specify the model you will use to test
the null hypothesis and the parameter of interest
– All models require assumptions, so state the assumptions and check any
corresponding conditions
– Your plan should end with a statement like
§ Because the conditions are satisfied, I can model the sampling distribution of
the proportion with a Normal model
7INF 1344H
Introduction to Statistics for Data Science
Lecture 9
Hypothesis Test, & t-Test of Sample Mean
The Reasoning of Hypothesis Testing (4 of 8)
2. Model
§ Watch out, though
§ It might be the case that your model step ends with “Because the conditions
are not satisfied, I can’t proceed with the text”
§ If that’s the case, stop and reconsider
– Each test we discuss in the book has a name that you should include in
your report
– The test about proportions is called a one-proportion z-test
8INF 1344H
Introduction to Statistics for Data Science
Lecture 9
Hypothesis Test, & t-Test of Sample Mean
One-Proportion z-Test
• The conditions for the one-proportion z-test are the same
as for the one proportion z-interval. We test the hypothesis
using the statistic
where
• When the conditions are met and the null hypothesis is
true, this statistic follows the standard Normal model, so
we can use that model to obtain a P-value
9INF 1344H
Introduction to Statistics for Data Science
Lecture 9
Hypothesis Test, & t-Test of Sample Mean
The Reasoning of Hypothesis Testing (5 of 8)
3. Mechanics
– Under “mechanics” we place the actual calculation of our test statistic from
the data
– Different tests will have different formulas and different test statistics
– Usually, the mechanics are handled by a statistics program or calculator,
but it’s good to know the formulas
10
INF 1344H
Introduction to Statistics for Data Science
Lecture 9
Hypothesis Test, & t-Test of Sample Mean
The Reasoning of Hypothesis Testing (6 of 8)
3. Mechanics
– The ultimate goal of the calculation is to obtain a P-value
– Definition of P-value
§ The P-value is the probability that the observed statistic value (or an even more
extreme value) could occur if the null model were correct
§ If the P-value is small enough, we’ll reject the null hypothesis
§ Note: The P-value is a conditional probability—it’s the probability that the
observed results could have happened if the null hypothesis is true
11
INF 1344H
Introduction to Statistics for Data Science
Lecture 9
Hypothesis Test, & t-Test of Sample Mean
For Example: Finding A P-Value (1 of 2)
RECAP: The Ministry of Transportation claims that 80% of
candidates pass driving tests, but a survey of 90 randomly
selected local teens who have taken the test found only 61 who
passed.
QUESTION: What’s the P-value for the one-proportion z-test?
ANSWER: I have n = 90, x = 61, and a hypothesized p = 0.80.