The blog discuss in details about theory of F test, its use cases, solved example (manually) and a demonstration using online tool Agri Analyze (Reading time 10 min)
Introduction
The F-test is a statistical method used to compare the variances of two samples or the ratio of variances across multiple samples. It assesses whether the data follow an F-distribution under the null hypothesis, assuming standard conditions for the error term (ε). The test statistic, denoted as F, is commonly used to compare fitted models to determine which best represents the underlying population. F-tests are frequently employed in models fitted using least squares. The test is named after Ronald Fisher, who introduced the concept as the “variance ratio” in the 1920s, with George W. Snedecor later naming the test in Fisher’s honor.
Definition
An F-test uses the F-statistic to evaluate whether the variances of two samples (or populations) are equal. The test assumes that the population follows an F-distribution and that the samples are independent. If the F-test yields statistically significant results, the null hypothesis of equal variances is rejected; otherwise, it is not.
Use of F-Test in Statistics
The F-test is a statistical tool used to compare variances and determine if there are significant differences between two populations or samples. It is commonly applied in regression analysis, statistical inference, model fitting, and analysis of variance (ANOVA) to identify the best-fitting statistical model or assess differences across groups.
- Regression analysis
- Statistical inference
- Model fitting
- Analysis of variance (ANOVA)
Assumptions
- Independence: The observations within each group must be independent, meaning there should be no relationship between observations across samples.
- Normality: Data in each group should follow a normal distribution. For large sample sizes, this assumption can be relaxed based on the Central Limit Theorem.
- Homogeneity of variances: The variances across groups being compared should be approximately equal.
Important Notes on the F-Test
- The F-test is used to assess whether the variances of two populations are equal by comparing them using an F distribution.
- The F-test statistic is calculated as , where and are the sample variances.
- The null hypothesis is evaluated using a critical value, which determines whether to reject the hypothesis.
- A common application of the F-test is the one-way ANOVA, which assesses variability between group means and within group observations.
Selection Criteria for σ₁² and σ₂² in an F-Test
- For a right-tailed or two-tailed F-test, the variance with the greater value is placed in the numerator, making the sample corresponding to σ₁² the first sample. The smaller variance (σ₂²) is the denominator for the second sample.
- For a left-tailed test, the smaller variance is in the numerator (sample 1), while the larger variance is in the denominator (sample 2).
Hypotheses
Left-Tailed Test:
- Null Hypothesis (H₀): σ₁² = σ₂²
- Alternative Hypothesis (H₁): σ₁²
- Decision Criteria: Reject H₀ if the F-statistic
Right-Tailed Test:
- Null Hypothesis (H₀): σ₁² = σ₂²
- Alternative Hypothesis (H₁): σ₁² > σ₂²
- Decision Criteria: Reject H₀ if the F-statistic > F-critical value.
Two-Tailed Test:
- Null Hypothesis (H₀): σ₁² = σ₂²
- Alternative Hypothesis (H₁): σ₁² ≠ σ₂²
Procedure for Conducting an F-Test:
-
Define Hypotheses
- Null Hypothesis (H₀): The variances of the groups are equal.
- Alternative Hypothesis (H₁): The variances of the groups are not equal.
-
Collect Data
Gather sample data from the groups being compared. -
Calculate Sample Variances
For each group, compute the sample variance (S²) using the formula:where represents the observations, is the sample mean, and is the sample size.
-
Calculate F-Statistic
Compute the F-statistic as follows:where is the larger variance and is the smaller variance.
-
Determine Degrees of Freedom
Calculate degrees of freedom for each group: -
Find the Critical Value
Using an F-distribution table, locate the critical value for your chosen significance level (e.g., ) based on and . -
Make a Decision
- If , reject the null hypothesis, indicating significant differences in variances.
- If , fail to reject the null hypothesis, suggesting no significant variance differences.
-
Conclusion
- Reject the null hypothesis if exceeds the critical value, indicating significant variance between groups.
- Fail to reject the null hypothesis if is less than or equal to the critical value, implying insufficient evidence for variance differences.
Example: –
Life
expectancy in 9 regions of Brazil in 1900 and 11 regions of Brazil in 1970 was
as given in the table below:
Region |
Life |
|
1900 |
1970 |
|
1 |
42.7 |
54.2 |
2 |
43.7 |
50.4 |
3 |
34.0 |
44.2 |
4 |
39.2 |
49.7 |
5 |
46.1 |
55.4 |
6 |
48.7 |
57.0 |
7 |
49.4 |
58.2 |
8 |
45.9 |
56.6 |
9 |
55.3 |
61.9 |
10 |
|
57.5 |
11 |
|
53.4 |
We aim to determine whether the variation in life expectancy across different regions in 1900 and 1970 is the same. Assuming the populations in 1900 and 1970 follow normal distributions, and , the hypotheses can be formulated as:
- Null Hypothesis : (the variances are equal)
- Alternative Hypothesis : (the variances are different)
The F-test is applied to evaluate these hypotheses.
-
Calculate Sample Variances:
-
Calculate the F-Statistic:
-
Conclusion:
The critical values from the F-distribution table at for a two-tailed test with degrees of freedom (8, 10) are and . Since the calculated F-value (1.603) is less than 3.85 and greater than 0.233, we fail to reject the null hypothesis. This indicates that there is no significant difference in the variances of life expectancy between 1900 and 1970 across the regions of Brazil.
F test Demonstration in Agri Analyze
Video Demo for F-test in Agri Analyze
Step1: Prepare data file and save in a csv format
Step4:
- Upload the file
- Select level of significance (for 5% write 0.05)
- Variable name: Life Expectancy
- Category Type: Time Frame
Step5: Click on Submit and Download