Give an example of a question you could answer with a hypothesis test.
Differentiate composite vs. simple hypotheses.
Given an inferential question, formulate null and alternative hypotheses to be used in a hypothesis test.
Identify the steps and components of a basic hypothesis test (“there is only one hypothesis test”).
Write computer scripts to perform hypothesis testing via simulation, randomization and bootstrapping approaches, as well as interpret the output.
Describe the relationship between confidence intervals and hypothesis testing.
Discuss the potential limitations of this simulation approach to hypothesis testing.
Suppose Apple claims that the new Macbook Pro can work for more than 20 hours without a recharge.
Note that in both examples, we are not trying to estimate a parameter, but rather test a claim.
We are not trying to know exactly the probability of rolling a 1 with the dice; we are trying to know if this probability is what it should be, \(1/6\).
We are not trying to estimate the average battery life of a Macbook Pro; we are trying to know if it is greater than 20 hours.
Formulate the hypotheses before viewing/analyzing the data.
Hypothesis test is like an argument by contradiction.
Start by assuming the null hypothesis is true, then assess whether the data is compatible with this assumption.
We start by collecting a sample and calculating the statistic that we are going to use for the test
A test statistic is a sample statistic used for hypothesis testing.
As usual, everything revolves around the distribution of our statistic.
If we want to test \(H_0\): \(p = 0.5\) what would be the sampling distribution of \(\hat{p}\) if \(H_0\) were true?
Do you expect a sample’s \(\hat{p}\) to be around 0.7 or 0.5?
Do you think it would be common or rare to observe a sample’s \(\hat{p}\) of 0.7 if \(H_0\) were true?
The idea is that once we get a sample and calculate the test statistic, we can compare it to the null distribution.
We need first to approximate the null distribution;
Data modified from Modern Dive: https://moderndive.com/B-appendixB.html
Significance level: predetermined value such that we reject \(H_0\) if the \(p\)-value is less than or equal to that number
Common significance levels: \(\alpha=0.01\), \(0.05\) or \(0.10\)
Choose the significance level before doing the analyses
If \(p\)-value \(\leq \alpha\; \Rightarrow\) Reject \(H_0\)
If \(p\)-value \(> \alpha\; \Rightarrow\) Do not reject \(H_0\)
We estimate the \(p\)-value to be 0.01, thus \(p\)-value < \(\alpha\)
What’s our conclusion?
We reject the null hypothesis
There is evidence that the true average age of first marriage for all US women from 2006 to 2010 is greater than 23 years
Probability of committing a type I error equals the significance level chosen for your test
E.g., for a right-tailed test with \(\alpha = 0.05\):
worksheet_06
We are here to help!
© 2024 Rodolfo Lourenzutti, Melissa Lee, Marie Auger-Méthé – Material Licensed under CC By-SA 4.0