UpSkill Sprint Consulting logoUpSkill Sprint Consulting

01 Meet the idea

Same data. A clearer view.

Statistical Transformations

A statistical transformation applies the same math rule to every value in one variable. It can reveal a pattern that large values were hiding.

Think of it as using the same conversion recipe. The records stay the same, but each original number is recalculated into a new number.

Show me why
ILLUSTRATIVE SALARY EXAMPLE

Can you spot the pattern?

Interactive

Each bar covers a range of salaries. A taller bar means more people fall in that range.

Illustrative, fictitious values for learning. These small datasets have only 12 observations, so check larger samples and more than one bin width before judging shape in real work.

01

One high salary stretches the ruler. Most salaries are squeezed into the first few bars.

02 Why transform?

Three messy datasets.
Three useful questions.

Transformations are tools—not automatic fixes. Start with the real-world question, then choose a rule that helps answer it.

THE REAL QUESTION

How can we compare typical salaries when one executive earns far more?

A $410k salary makes differences among $32k–$72k employees hard to see. A log transformation gives the smaller salaries more visual room. For a descriptive typical salary, also report the median on the original dollar scale.

TRY\(y=\log_{10}(x)\)Compresses the very high value

03 Transformation playground

Change the rule.
Watch the shape respond.

Select a dataset and a transformation. The left chart stays original, so you always have a fair comparison.

1. Choose an example dataset
2. Choose a rule

Log requires \(x>0\).

All five choices are mathematically allowed here. That does not mean all five answer the salary question well.

BEFORE

Original data

salary ($000s)
AFTER

After log

\(\log_{10}(\mathrm{salary})\)
1.0×
Original2.5× largest value
WHAT CHANGED?

The high salary moves closer to the rest, making differences among typical salaries easier to see.

Same recordsNew log values

A transformation does not delete unusual values or guarantee a bell-shaped distribution. It changes the numerical values. You still need to inspect the data and explain the rule you used.

04 The four transformations

Choose by the job,
not by the formula.

Open each method for a plain-language explanation, a real use case, and the one rule you must remember.

01COMPRESS A FEW VERY HIGH VALUESLog transformation\(y=\log_{10}(x)\)

Large values move much closer together.

After applying \(y=\log_{10}(x)\), equal original ratios become equal differences. The jumps from \(10\) to \(100\) and from \(100\) to \(1{,}000\) are equivalent because \(\frac{100}{10}=\frac{1{,}000}{100}=10\).

REAL USE

Salary or house prices: compare typical values without letting a few very large values dominate the view.

\(\log_{10}(10)\)=\(1\)
\(\log_{10}(100)\)=\(2\)
\(\log_{10}(1{,}000)\)=\(3\)

Remember: \(y=\log_{10}(x)\) requires \(x>0\).

02GENTLY COMPRESS COUNTSSquare root\(y=\sqrt{x}\)

Zero stays zero; high counts shrink.

The square-root transformation, \(y=\sqrt{x}\), is gentler than a log transformation. It is useful when data are counts and zero is a meaningful result.

REAL USE

Defects per batch: keep zero-defect batches while reducing the visual pull of batches with many defects.

\(\sqrt{0}\)=\(0\)
\(\sqrt{4}\)=\(2\)
\(\sqrt{16}\)=\(4\)

Remember: \(y=\sqrt{x}\) requires \(x\ge 0\).

03TURN TIME INTO RATEReciprocal\(y=\frac{1}{x}\)

For positive values, the unit flips and the order reverses.

If \(x\) is measured in minutes per task, then \(y=\frac{1}{x}\) is measured in tasks per minute. Shorter positive times become higher rates, so faster performance now appears larger.

REAL USE

Production cycle time: \(5\ \mathrm{min/item}\) becomes \(0.2\ \mathrm{item/min}=12\ \mathrm{items/h}\).

\(\frac{1}{2\ \mathrm{min}}\)=\(0.50\ \mathrm{min}^{-1}\)
\(\frac{1}{5\ \mathrm{min}}\)=\(0.20\ \mathrm{min}^{-1}\)
\(\frac{1}{10\ \mathrm{min}}\)=\(0.10\ \mathrm{min}^{-1}\)

Remember: \(y=\frac{1}{x}\) is undefined at \(x=0\) and magnifies values near zero.

04PUT DIFFERENT UNITS ON ONE SCALEScaling & centering\(z=\frac{x-\bar{x}}{s}\)

Measure distance from the group average.

For a sample, calculate \(z=\frac{x-\bar{x}}{s}\): subtract the sample mean, \(\bar{x}\), then divide by the sample standard deviation, \(s\). The result says how far a value is from its group in standard-deviation units.

REAL USE

Machine learning: put salary, temperature, and distance on comparable scales before K-Means or gradient descent. A z-score centres each feature at \(0\); min–max scaling usually maps the observed minimum to \(0\) and maximum to \(1\).

For prediction: calculate the mean, standard deviation, minimum, and maximum from the training data only, then reuse those values for validation and test data. Outliers can strongly affect both z-scores and min–max scaling.

\(x=\bar{x}-s\)→\(z=-1\)
\(x=\bar{x}\)→\(z=0\)
\(x=\bar{x}+s\)→\(z=+1\)

Remember: centring subtracts \(\bar{x}\); z-scoring also divides by \(s\). These choices change centre and scale, not order or distribution shape.

05 Axis playground

Same values.
Different ruler.

Changing an axis changes where points are drawn. It does not change the stored data.

LINEAR × LINEAR

Equal differences get equal space.

Both axes use an ordinary ruler. Values near 1 are crowded because the range reaches 1,000.

Same 7 observations
x: linear · y: linear
Stored points(1,1)(5,8)(10,9)(50,55)(100,90)(500,600)(1000,1000)
05001,000

Linear: the distance from 0 to 500 equals the distance from 500 to 1,000.

B

Semi-log

Only one axis is logarithmic. An exponential relationship, \(y=ab^x\), can look straight when the \(y\)-axis is logarithmic. A straight-looking line suggests that pattern; it does not prove it.

C

Log-log

Both axes are logarithmic. It is useful when both quantities cover many powers of \(10\). A power relationship, \(y=ax^b\), can look straight and its slope represents \(b\); a straight-looking line suggests the model but does not prove it.

\(0\)

Ordinary log axes cannot display zero or negative values.

06 Means lab

“Average” depends
on the question.

The arithmetic, geometric, and harmonic means answer different real-world questions. Learn what each one preserves, then test the choice in real situations.

Quick challenge

Which average rate is right?

A finishing line processes \(100\,\mathrm{t}\) at \(50\,\mathrm{t\,h}^{-1}\), then another \(100\,\mathrm{t}\) at \(100\,\mathrm{t\,h}^{-1}\). What was the line’s overall rate?

Commit to an answer. The time check will show why.

Choose an answer to reveal the time check.

Start here

Three methods in plain words

An average replaces several values with one representative value. The right method depends on what must remain unchanged.

Values add

Share one total equally.

Use the arithmetic mean when the values are ordinary amounts on a linear scale and their sum is meaningful.

\(\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i\)
  1. 1Add the Charpy energies: \(42+48+51=141\,\mathrm{J}\).
  2. 2Divide by the three specimens: \(\frac{141\,\mathrm{J}}{3}=47\,\mathrm{J}\).
  3. 3Check the preserved total: \(3(47\,\mathrm{J})=141\,\mathrm{J}\).
MeanRecipeFormulaUse it when
ArithmeticAdd, then divide by the count\(\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i\)Amounts add to a meaningful total
GeometricMultiply, then take the \(n\)-th root\(G=\left(\prod_{i=1}^{n}x_i\right)^{\frac{1}{n}}\)Positive factors multiply or compound
HarmonicAverage reciprocals, then take the reciprocal\(H=\frac{n}{\sum_{i=1}^{n}\frac{1}{x_i}}\)Rates apply over equal amounts or distances
Words used in this section
Rate
An amount per unit of something else, such as tonnes per hour or kilometres per hour.
Reciprocal
One divided by a number. The reciprocal of \(4\) is \(\frac{1}{4}=0.25\).
Growth factor
A percentage change written as a multiplier: \(+10\%\rightarrow1.10\) and \(-25\%\rightarrow0.75\).
Compounding
Each change acts on the previous result, so the factors multiply.
\(n\)-th root
The value that produces the original number when multiplied by itself \(n\) times.
The central idea

What must stay unchanged?

Ask what one repeated value could replace every observation without changing the quantity that matters.

MeanWhat it preservesReal-world meaning
ArithmeticThe sum: \(n\bar{x}=\sum_{i=1}^{n}x_i\)Total energy, output, length, or cost
GeometricThe product: \(G^n=\prod_{i=1}^{n}x_i\)The same compound endpoint from positive growth factors or ratios
HarmonicThe reciprocal sum: \(\frac{n}{H}=\sum_{i=1}^{n}\frac{1}{x_i}\)Time per common unit; for equal amount \(q\), total time is \(T=q\sum_{i=1}^{n}\frac{1}{x_i}=\frac{qn}{H}\)
Interactive comparison

See all three means on one line

Choose a situation or enter your own values. The cards calculate all three means while “Best fit” answers the real question.

Choose a situation

Four days of production, in units.

THE QUESTION

What was the typical number of units produced per day?

\(G\)
GEOMETRIC MEAN\(44.944\)

\(G=\left(\prod_{i=1}^{n}x_i\right)^{\frac{1}{n}}\), for positive multiplicative factors.

\(H\)
HARMONIC MEAN\(44.889\)

\(H=\frac{n}{\sum_{i=1}^{n}\frac{1}{x_i}}\), for rates over equal amounts.

Order only—not to scale. For positive values, \(H\le G\le\bar{x}\), with equality only when all values match.

Values and mean locations
Why geometric?

Compounding changes the answer

A rise and an equal-sized fall do not cancel because the second percentage acts on a different starting value. Adjust the two quarterly changes and compare the projections.

Why harmonic?

What is held fixed decides

A slow rate lasts longer when each leg must complete the same amount. Switch the constraint and watch the correct mean change.

ARITHMETIC\(75\,\mathrm{t\,h}^{-1}\)
GEOMETRIC\(70.71\,\mathrm{t\,h}^{-1}\)
HARMONIC\(66.67\,\mathrm{t\,h}^{-1}\)
Decision guide

Pick the mean in three questions or fewer

Answer questions about how the values behave—not simply how the histogram looks.

Practice

Choose the mean in plant-floor situations

Eight short scenarios test whether you can identify the quantity that must be preserved.

Take this with you

Match the mean to the mechanism

The shape of the numbers may offer a clue, but the real question is what the calculation must preserve.

Values add

Arithmetic

Use \(\bar{x}\) for additive measurements and totals on a linear scale.

Values multiply

Geometric

Use \(G\) for positive factors, ratios, and compound change.

Rates, fixed amount

Harmonic

Use \(H\) for rates over equal work or distance. For unequal amounts, use total amount divided by total time.

For positive values, \(H\le G\le\bar{x}\), with equality if and only if all values are equal.

Use the three means in Python
import numpy as np
from scipy import stats

x = np.array([2, 8])
np.mean(x)      # arithmetic: 5.0
stats.gmean(x)  # geometric: 4.0
stats.hmean(x)  # harmonic: 3.2

# Unequal amounts: total amount / total time
tons = np.array([100, 300])
rate = np.array([50, 100])
combined_rate = tons.sum() / (tons / rate).sum()  # 80.0 t/h

07 Decision guide

What are you trying to do?

Pick the sentence that sounds most like your situation. You’ll get a starting point—not an automatic answer.

YOUR STARTING POINT
\(\log_{10}\)
TRANSFORMATION

Try \(y=\log_{10}(x)\)

It compresses a few very high positive values more than the smaller ones.

Check first: \(x>0\).
Then inspect the result; a log transformation does not guarantee a bell shape.

08 Statistics implementation

Move from the idea
to the software.

Use these steps after you have chosen a transformation for a clear reason. Keep the original column so you can compare before and after.

Excel Functions

Assume the first original value is in A2. Fill the formula down a new column instead of overwriting the raw data.

FunctionSyntaxPurposeWhen to use it
LOG10=LOG10(A2)Base-10 logarithm.Positive data with a long right tail, especially when powers of 10 are meaningful.
LOG=LOG(A2,base)Logarithm using a chosen base.When the field uses a base other than 10.
LN=LN(A2)Natural logarithm, base e.Growth models, rates, and many regression workflows.
SQRT=SQRT(A2)Square-root transformation.Nonnegative count data where zero must remain zero.
POWER=POWER(A2,0.5)General power transformation; 0.5 is square root.When a power other than one-half is required or a model specifies the exponent.
Reciprocal formula=1/A2Changes a duration into a rate and reverses the order.Positive time-per-unit data; multiply by 60 when converting a per-minute result to per hour.
STANDARDIZE=STANDARDIZE(A2,mean,standard_dev)Returns a z-score.Comparing measurements with different units or preparing features for scale-sensitive algorithms.
MIN / MAX=MIN(A2:A13)Provides the endpoints for min–max scaling.Mapping a feature to 0–1 when its training range is nonzero.
AVERAGE=AVERAGE(A2:A13)Arithmetic mean.Ordinary additive amounts such as daily output.
STDEV.S / STDEV.P=STDEV.S(A2:A13)Sample or population standard deviation used in z-scores.Use STDEV.S for a sample and STDEV.P only when the range is the full population.
GEOMEAN=GEOMEAN(A2:A5)Geometric mean.Positive growth factors or compounded change.
HARMEAN=HARMEAN(A2:A3)Harmonic mean.Positive rates measured over equal distances or equal work amounts.

Excel Use Cases

SALARIES

Compress a long right tail

With salary in A2, enter =LOG10(A2) in B2 and fill down. Compare histograms of columns A and B. Do not use the formula if any salary is zero or negative.

DEFECT COUNTS

Keep zero-defect batches

Enter =SQRT(A2). A count of 0 stays 0, while 16 becomes 4, reducing the visual pull of the high count.

CYCLE TIME

Convert minutes into output rate

For 5 minutes per item, =1/A2 gives 0.2 items per minute. Use =60/A2 for 12 items per hour.

MIXED UNITS

Create a z-score or 0–1 scale

For a sample in A2:A13, use =STANDARDIZE(A2,AVERAGE($A$2:$A$13),STDEV.S($A$2:$A$13)). For min–max scaling, use =(A2-MIN($A$2:$A$13))/(MAX($A$2:$A$13)-MIN($A$2:$A$13)). Fit these values on training data only.

Minitab Navigation

Log, square root, or reciprocal: choose Calc → Calculator. Store the result in a new column and enter LOGTEN('Salary'), SQRT('Defects'), or 1/'Cycle time'.

Z-scores, centring, or min–max: choose Calc → Standardize, select the input and destination columns, then choose Subtract mean and divide by standard deviation, Subtract mean, or Make range from start to end and enter 0 and 1.

Logarithmic chart scale: choose Graph → Graph Builder → Scatterplot, add the variables, then under Scale select Log transformation: Y-scale, X-scale, or both. Use this when you want different spacing while the stored worksheet values remain unchanged.

Exam Tips

  • Separate data from display: a transformation creates a new variable; a log axis changes only the ruler.
  • Check the allowed values: ordinary logs require positive values, square root accepts zero, and reciprocals reject zero.
  • Match the mean to the question: arithmetic for additive amounts, geometric for compound factors, and harmonic for equal-distance rates.
  • Do not claim automatic normality: always inspect the transformed data and explain why the chosen rule supports the analysis.
  • For ASQ CSSBB/CQE questions: identify the data domain and analytical purpose before choosing a transformation; watch for zero values and rate questions that require the harmonic mean.
  • In real projects: keep the raw column, name the transformed column clearly, document the formula, and report results in understandable units when possible.

09 Takeaway

Change the scale.
Keep the story honest.

1Start with the real question. A formula is useful only when it clarifies something meaningful.

2Check the allowed values. Log needs positives; square root accepts zero; reciprocal rejects zero.

3Explain what changed. A transformed variable, a log axis, and a different mean solve different problems.

Knowledge check

Check your understanding

Comprehension quiz

Pick the strongest answer, then submit. Explanations appear after you submit.

1. Most salaries are moderate, but a few are much higher. Which choice most directly compresses those high positive values?
2. Defect counts include \(0\). Which transformation keeps \(0\) and compresses the larger counts?
3. A process takes \(5\,\mathrm{min\,item^{-1}}\). What rate does its reciprocal represent?
4. Which statement correctly separates the transformation \(z_i=\frac{x_i-\bar{x}}{s}\) from a logarithmic axis?
5. Let \(A\), \(G\), and \(H\) denote the arithmetic, geometric, and harmonic means. Which complete set of matches is correct?
← Back to Data Analytics lessons