Track 14 · Practical Data Analysis · Lesson 7 of 11
Transforming variables
Choose and apply a log transformation, a ratio, binning or standardisation, and interpret results on the transformed scale.
A property analyst wants to compare house prices across districts. Raw prices are dominated by a few very expensive villas, big houses cost more simply because they are big, and a buyer wants to know whether a sale was unusually expensive. Each of those problems has its own transformation — and its own way of being misread.
A transformation replaces each value of a variable with a function of it, or builds a new variable from several. It does not change the data you collected; it changes the scale on which you look at them. Four transformations cover most practical work:
- Log — pulls in a long right tail and turns multiplicative differences (×2) into additive ones.
- Ratio — divides by a measure of size (per m², per customer, per 1 000 people) so units of different size can be compared.
- Binning — groups a numeric variable into ranges (bands) for tables and reporting.
- Standardising — expresses a value as a number of standard deviations from the mean (a z-score), so variables with different units can be compared.
Included with a Formula Quest membership
It has 8 graded exercises with feedback, hints and worked solutions. After it you will be able to:
- Apply a log transformation to positive, right-skewed data and back-transform the mean of the logs to a geometric mean
- Build ratios such as price per m², and distinguish the ratio of means from the mean of ratios
- Bin a numeric variable with stated, non-overlapping cut points and count each band
- Standardise values to z-scores with the sample SD and explain what they do and do not change