# Coding in Statistics

## Idea

In Statistics, coding refers to applying a fixed transformation to the values in a data set. The most common transformation is a linear one of the form:

$x \mapsto a x + b$

for some constants $a$ and $b$.

## Examples

1. Changing units. For example, if the data is temperature and was originally recorded as Fahrenheit then to adjust it to Centigrade we apply the coding $c = \frac{5}{9} (f - 32)$.

2. Simplifying numbers. For example, population might be measured in thousands so is coded as $x/1000$.