F-Test - GeeksforGeeks

26 Nov, 2020
F-Test is any test that utilizes the F-Distribution table to fulfil its purpose (for eg: ANOVA). It compares the ratio of the variances of two populations and determines if they are statistically similar or not. 
We can use this test when :
The population is normally distributed.
The samples are taken at random and are independent samples.
Formulas Used
where, 
Fcalc = Critical F-value.
σ12 & σ22 = variance of the two samples.

where,
df = Degrees of freedom of the sample. 
nS = Sample size.
Steps involved: 
Step 1: Use Standard deviation (σ) and find variance (σ2) of the data. (if not already given)
Step 2: Determine the null and alternate hypothesis.
  H0 -> no difference in variances.
  Ha -> difference in variances.
Step 3: Find Fcalc using Eq-1.
NOTE : While calculating Fcalc, divide the larger variance with small variance as it makes calculations easier.
Step 4: Find the degrees of freedom of the two samples.
Step 5: Find Ftable value using d1 and d2 obtained in Step-4 from the F-distribution table. (link here). Take learning rate, α = 0.05 (if not given) 
Looking up the F-distribution table: 
In the F-Distribution table (Link here), refer the table as per the given value of α in the question. 
d1 (Across) = df of the sample with numerator variance.  (larger)
d2 (Below) = df of the sample with denominator variance. (smaller)
Consider the F-Distribution table given below,
While performing One-Tailed F-Test.
GIVEN : α = 0.05d1 = 2d2 = 3
1
2 
1
2
3
:
:
:
Then, Ftable = 9.55
Step 6: Interpret the results using Fcalc and Ftable.
Interpreting the results:
If Fcalc < Ftable :
    Cannot reject null hypothesis.
    ∴ Variance of two populations are similar. 
    
If Fcalc > Ftable :
    Reject null hypothesis. 
    ∴ Variance of two populations are not similar.

Example Problem (Step by Step)
Consider the following example, 
Conduct a two-tailed F-Test on the following samples: 
σ
10.47
8.12
n
41
21
Step 1:
σ12 = (10.47)2 = 109.63 
σ22 = (8.12)2 = 65.99
Step 2:
H0: no difference in variances.
Ha: difference in variances.
Step 3:Fcalc = (109.63 / 65.99) =  1.66
Step 4:d1 = (n1 – 1) = (41 – 1) = 40d2 = (n2 — 1) = (21 – 1) = 20
Step 5 - Using d1 = 40 and d2 = 20 in the F-Distribution table. (link here)
      Take α = 0.05 as it's not given.
      Since it is a two-tailed F-test, 
      α = 0.05/2 
       = 0.025     
     Therefore, Ftable = 2.287

Step 6 - Since Fcalc < Ftable (1.66 < 2.287):
     We cannot reject null hypothesis.
     ∴ Variance of two populations are similar to each other.     

F-Test is the most often used when comparing statistical models that have been fitted to a data set to identify the model that best fits the population.  Researchers usually use it when they want to test whether two independent samples have been drawn from a normal population with the same variability. For any doubt/query, comment below. 
Machine Learning
Machine Learning
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Comments
Old Comments
Support Vector Machine Algorithm
k-nearest neighbor algorithm in Python
Singular Value Decomposition (SVD)
Difference between Informed and Uninformed Search in AI
DBSCAN Clustering in ML | Density based clustering
Intuition of Adam Optimizer
Principal Component Analysis with Python
Python | Decision Tree Regression using sklearn
Normalization vs Standardization
CNN | Introduction to Pooling Layer