What is F statistic in R and how to interpret it?

What is F statistic in R and how to interpret it

Recipe Objective

F-statistic is the ratio of two variances. It is named after Sir R. Fisher. It considers both between group variability as well as within group variability. Large F signifies greater dispersion. ​

F-test is used when you want to get the following insight: ​

  1. Whether the two samples coming from populations have equal variances.
  2. Wheteher a new process reduces the variance of existing process

Hypothesis testing with ANOVA includes the following: ​

  1. Null Hypothesis: There is no difference in the sample variances
  2. Alternate Hypothesis: The sample variances are not equal

In this recipe, we learn how to perform F-test in R. ​

STEP 1: Defining two groups with numeric values

group1 = c(33, 18, 22, 35, 46, 55, 20, 27, 34, 15) group2 = c(14, 15, 25, 27, 40, 45, 34, 60, 55, 58)

STEP 2: Carrying out F-test

var.test(group1,group2)

F test to compare two variances

data:  group1 and group2
F = 0.55868, num df = 9, denom df = 9, p-value = 0.3988
alternative hypothesis: true ratio of variances is not equal to 1
95 percent confidence interval:
 0.1387681 2.2492399
sample estimates:
ratio of variances 
         0.5586794 

Result: After checking the p-value of the F-statistic, we see that it's higher than 0.05. This means that we accept the null hypothesis i.e. There is no difference in the two group variances

What Users are saying..

profile image

Ed Godalle

Director Data Analytics at EY / EY Tech
linkedin profile url

I am the Director of Data Analytics with over 10+ years of IT experience. I have a background in SQL, Python, and Big Data working with Accenture, IBM, and Infosys. I am looking to enhance my skills... Read More

Relevant Projects

Build an End-to-End AWS SageMaker Classification Model
MLOps on AWS SageMaker -Learn to Build an End-to-End Classification Model on SageMaker to predict a patient’s cause of death.

NLP Project to Build a Resume Parser in Python using Spacy
Use the popular Spacy NLP python library for OCR and text classification to build a Resume Parser in Python.

Build a Multi Class Image Classification Model Python using CNN
This project explains How to build a Sequential Model that can perform Multi Class Image Classification in Python using CNN

NLP Project on LDA Topic Modelling Python using RACE Dataset
Use the RACE dataset to extract a dominant topic from each document and perform LDA topic modeling in python.

Ola Bike Rides Request Demand Forecast
Given big data at taxi service (ride-hailing) i.e. OLA, you will learn multi-step time series forecasting and clustering with Mini-Batch K-means Algorithm on geospatial data to predict future ride requests for a particular region at a given time.

Build Deep Autoencoders Model for Anomaly Detection in Python
In this deep learning project , you will build and deploy a deep autoencoders model using Flask.

Build Classification Algorithms for Digital Transformation[Banking]
Implement a machine learning approach using various classification techniques in Python to examine the digitalisation process of bank customers.

Build a Credit Default Risk Prediction Model with LightGBM
In this Machine Learning Project, you will build a classification model for default prediction with LightGBM.

NLP Project for Beginners on Text Processing and Classification
This Project Explains the Basic Text Preprocessing and How to Build a Classification Model in Python

Build a Speech-Text Transcriptor with Nvidia Quartznet Model
In this Deep Learning Project, you will leverage transfer learning from Nvidia QuartzNet pre-trained models to develop a speech-to-text transcriptor.