Hypothesis Tests
Definitions
- In a hypothesis test, you take a claim and test it against statistical evidence.
- The claim that you’re testing is called the null hypothesis test. It’s represented as
, and it’s the claim that’s accepted unless there’s strong statistical evidence against it. - The alternate hypothesis is the claim we’ll accept if there’s strong enough evidence against
. It’s represented by . - The test statistic is the statistic you use to test your hypothesis. It’s the statistic that’s most relevant to the test. You choose the test statistic by assuming that
is true. - The significance level is represented by
. It’s a way of saying how unlikely you want your results to be before you’ll reject - The critical region is the set of values that presents the most extreme evidence against the null hypothesis test. You choose your critical region by considering the significance level and how many tails you need to use.
- A one-tailed test is when your critical region lies in either the upper or the lower tail of the data (
). A two-tailed test is when it’s split over both ends ( ). You choose your tail by looking at your alternate hypothesis. - A p-value is the probability of getting the result of your sample, or a result more extreme in the direction of your critical region.
- If the p-value lies in the critical region, you have sufficient reason to reject your null hypothesis. If your p-value lies outside your critical region, you have insufficient evidence.
Testing Steps
- Decide on the hypothesis you’re going to test
- Choose your test statistic
- Determine the critical region for your decision
- Find the p-value of the test statistic
- See whether the sample result is within the critical region
- Make your decision
Example
drug company claims a drug cures 90% of patients in 2 weeks. Here's a doctor's data:
Cured? | Yes | No |
---|---|---|
Frequency | 11 | 4 |
, where % - therefore we fail to reject
Errors
- A Type I error is when you reject the null hypothesis when it’s actually correct. The probability of getting a Type I error is
, the significance level of the test. - A Type II error is when you accept the null hypothesis when it’s wrong. The probability of getting a Type II error is represented by
. - To find
, your alternate hypothesis must have a specific value. You then find the range of values outside the critical region of your test, and then find the probability of getting this range of values under .
Accept |
Reject |
|
---|---|---|
✅ | Type I error | |
Type II error | ✅ |
- The power of a hypothesis test is the probability that we will reject
when is false. In other words, it’s the probability that we will make the correct decision to reject .
Example
drug company claims a drug cures 90% of patients in 2 weeks. Here's a doctor's data:
Cured? | Yes | No |
---|---|---|
Frequency | 80 | 20 |
Find values outside critical region:
De-standardize to find
Find
This means that the probability that we will make the correct decision to reject the null hypothesis is 0.898
Distribution
Use Cases
Two Variables
Goodness of Fit or Independence
Steps
- Decide on the hypothesis you’re going to test, and its alternative
- Find the expected frequencies and the degrees of freedom
- Determine the critical region for your decision
- Calculate the test statistic
- See whether the test statistic is within the critical region
- Make your decision
Distribution | Condition | |
---|---|---|
Binomial | You know what |
$$\nu=n-1$$ |
Binomial | You don’t know what |
$$\nu=n-2$$ |
Poisson | You know what |
$$\nu=n-1$$ |
Poisson | You don’t know what |
$$\nu=n-2$$ |
Normal | You know what |
$$\nu=n-1$$ |
Normal | You don’t know what |
$$\nu=n-3$$ |
Sources: 1 |