*41*

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

**z _{i} = 2 * ((x_{i} â€“ x_{min}) / (x_{max} â€“ x_{min})) â€“ 1**

where:

**z**The i_{i}:^{th}normalized value in the dataset**x**The i_{i}:Â^{th}value in the dataset**x**: The minimum value in the dataset_{min}**x**The maximum value in the dataset_{max}:

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:

**z**= 2 * ((13 â€“ 13) / (71 â€“ 13)) â€“ 1 =_{i}= 2 * ((x_{i}â€“ x_{min}) / (x_{max}â€“ x_{min})) â€“ 1**-1**

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

**z**= 2 * ((16 â€“ 13) / (71 â€“ 13)) â€“ 1 =_{i}= 2 * ((x_{i}â€“ x_{min}) / (x_{max}â€“ x_{min})) â€“ 1**-0.897**

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

**z**= 2 * ((19 â€“ 13) / (71 â€“ 13)) â€“ 1 =_{i}= 2 * ((x_{i}â€“ x_{min}) / (x_{max}â€“ x_{min})) â€“ 1**-0.793**

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

Each value in the normalized dataset is now between -1 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 -1.
- 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 -1 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 too influential, especially if itâ€™s measured in different units (i.e. if one variable is measured in inches and another is measured in yards).

Also note that the normalization method we used here is only one possible option.

In some cases, it makes sense to instead normalize variables between 0 and 1 or even between 0 and 100.

**Additional Resources**

The following tutorials explain how to perform other types of normalization:

How to Normalize Data Between 0 and 1

How to Normalize Data Between 0 and 100