9.1 C
London
Friday, December 20, 2024
HomeStatistics TutorialStatologyHow to Normalize Data Between 0 and 1

How to Normalize Data Between 0 and 1

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

To normalize the values in a dataset to be between 0 and 1, you can use the following formula:

zi = (xi – min(x)) / (max(x) – min(x))

where:

  • zi: The ith normalized value in the dataset
  • xiThe ith value in the dataset
  • min(x): The minimum value in the dataset
  • max(x): The maximum value in the dataset

For example, suppose we have the following dataset:

The minimum value in the dataset is 13 and the maximum value is 71.

To normalize the first value of 13, we would apply the formula shared earlier:

  • zi = (xi – min(x)) / (max(x) – min(x))  = (13 – 13) / (71 – 13) = 0

To normalize the second value of 16, we would use the same formula:

  • zi = (xi – min(x)) / (max(x) – min(x)) = (16 – 13) / (71 – 13) = .0517

To normalize the third value of 19, we would use the same formula:

  • zi = (xi – min(x)) / (max(x) – min(x)) = (19 – 13) / (71 – 13) = .1034

We can use this exact same formula to normalize each value in the original dataset to be between 0 and 1:

Normalize data between 0 and 1

Using this normalization method, the following statements will always be true:

  • The normalized value for the minimum value in the dataset will always be 0.
  • The normalized value for the maximum value in the dataset will always be 1.
  • The normalized values for all other values in the dataset will be between 0 and 1.

When to Normalize Data

Often we normalize variables when performing some type of analysis in which we have multiple variables that are measured on different scales and we want each of the variables to have the same range.

This prevents one variable from being overly influential, especially if it’s measured in different units (i.e. if one variable is measured in inches and another is measured in yards).

It’s also worth noting that we used a method known as min-max normalization in this tutorial to normalize the data values.

The two most common normalization methods are as follows:

1. Min-Max Normalization

  • Objective: Converts each data value to a value between 0 and 100.
  • Formula: New value = (value – min) / (max – min) * 100

2. Mean Normalization

  • Objective: Scales values such that the mean of all values is 0 and std. dev. is 1. 
  • Formula: New value = (value – mean) / (standard deviation)

Additional Resources

The following tutorials explain how to normalize data using different statistical softwares:

How to Normalize Data in Excel
How to Normalize Data in R
How to Normalize Columns in Python

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories