Hypothesis Testing
In null hypothesis significant testing, we are testing the validity of a claim about a population against a counter claim using sample data.
Null Hypothesis, : A hypothesis claiming no difference between sample and population
Alternative Hypothesis, : A hypothesis contradicting , which is usually what we're trying to prove.
| Do Not Reject | Reject |
---|
is True | Correct Decision (True Negative) | Type I Error (False Positive) |
is False | Type II Error (False Negative) | Correct Decision (True Positive) |
Test Statistic, : A statistic used to test our hypothesis.
Significance Level, : Probability threshold of rejection of . This is the probability of getting a type I error.
-value: The probability of observing a statistic as extreme or more extreme than the one observed under the assumption that is true.
Power of the Test: Probability of rejecting when is true.
-Test
Setup & Assumptions
- Samples:
- is unknown, is known
Null Hypothesis
Alternative Hypothesis
Test Statistic
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Left-tailed | | | |
Right-tailed | | | |
Two-tailed | | | |
-Test: Two Samples
Setup & Assumptions
- Samples: and
- ,
- are unknown, are known
Null Hypothesis
Alternative Hypothesis
Test Statistic
where is the pooled population variance:
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Left-tailed | | | |
Right-tailed | | | |
Two-tailed | | | |
-Test
Setup & Assumptions
- Samples:
- are unknown
Null Hypothesis
Alternative Hypothesis
Test Statistic
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Left-tailed | | | |
Right-tailed | | | |
Two-tailed | | | |
-Test: Two Samples with Equal Variances
Setup & Assumptions
- Samples: and
- ,
- are unknown
Null Hypothesis
Alternative Hypothesis
Test Statistic
where is the pooled sample variance:
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Left-tailed | | | |
Right-tailed | | | |
Two-tailed | | | |
-Test: Two Samples with Unequal Variances
Setup & Assumptions
- Samples: and
- ,
- are unknown
Null Hypothesis
Alternative Hypothesis
Test Statistic
where is the pooled sample variance:
Null Distribution
where is the degrees of freedom, defined by,
where is the nearest integer of .
Test Type | p-value | Python | R |
---|
Left-tailed | | | |
Right-tailed | | | |
Two-tailed | | | |
-Test for Equal Means (One Way ANOVA)
Setup & Assumptions
- Samples: sets of samples,
- are unknown
Null Hypothesis
Alternative Hypothesis
Test Statistic
where,
Null Distribution
Test Type | p-value | Python | R |
---|
Right-tailed | | | |
-Test for Equal Variances
Setup & Assumptions
- Samples: and
- ,
- are unknown
Null Hypothesis
Alternative Hypothesis
Test Statistic
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Left-tailed | | | |
Right-tailed | | | |
Two-tailed | | | |
-Test for Variance
Setup & Assumptions
- Samples:
- are unknown
Null Hypothesis
Alternative Hypothesis
Test Statistic
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Left-tailed | | | |
Right-tailed | | | |
Two-tailed | | | |
-Test for Goodness of Fit: Single Specific Distribution
Setup & Assumptions
- Samples: , where
- Distribution:
- Frequency: , where is the number of occurrences of in the sample , which means
Null Hypothesis
Alternative Hypothesis
Test Statistic
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Right-tailed | | | |
-Test for Goodness of Fit: Statistical Model
Setup & Assumptions
- Samples: , where
- Statistical Model:
- Frequency: , where is the number of occurrences of in the sample , which means
Null Hypothesis
Alternative Hypothesis
Test Statistic
where is the maximum likelihood estimate of under .
Null Distribution
where is the dimension of the parameter space .
p-Value
Test Type | p-value | Python | R |
---|
Right-tailed | | | |
-Test for Goodness of Fit: Independence
Setup & Assumptions
- Samples: , where and
- Distribution:
- Frequency: is the number of occurrences of in the sample and is the number of occurrences of in the sample , which means
- Maximum Likelihood Estimate:
Null Hypothesis
Alternative Hypothesis
Test Statistic
Null Distribution
p-Value
Test Type | p-value | Python | R |
---|
Right-tailed | | | |