Coding is a method of transforming data so that the numbers are easier to manipulate. Numbers that are not too small and not too large are easier to work with, so if the raw data we start with consists of large numbers for example – and finding the standard deviation or variance will make them even larger, since we must find - we may wish to make them smaller using a coding relationship of the formandwhereandare the original data and andthe transformed data. We can then do the calculations, finding the correlation coefficient, the equation of the regression line for the transformed data. We have to transform back to the original variablesandusing the original coding relationship. The correlation coefficient is unaltered- the correlation coefficient for the relationship betweenandis the same as that for the relationship betweenand
Example: A company owns two petrol stationsandalong a main road. Total daily sales in the same week for(£) and for(£) are summarised in the table below.
The data are coded using the relationshipandobtaining the new table below.
The summary statistics for the table above are:
SoWe have to transform back to the original variablesand
Rearrangement of this equation givesThe negative sign means the two petrol stations are partially in competition – if one sells more, the other sells less.