In statistics, a Z-score (also known as a standard score) represents how many standard deviations a particular data point is from the mean of a data set. It is a crucial tool for identifying outliers and comparing data points from different normal distributions.
The Z Calculation Formula
The calculation is straightforward but powerful. To find the Z-score, you subtract the population mean from the individual raw score and then divide the result by the population standard deviation.
z = (x – μ) / σ
Where:
z is the Z-score.
x is the value being evaluated (raw score).
μ (mu) is the mean of the population.
σ (sigma) is the standard deviation of the population.
How to Interpret Z-Score Results
Understanding the output is key to data analysis:
Z = 0: The score is exactly the same as the mean.
Positive Z: The score is above the average. A Z-score of +2.0 means the value is 2 standard deviations higher than the mean.
Negative Z: The score is below the average. A Z-score of -1.5 means the value is 1.5 standard deviations lower than the mean.
Practical Example: SAT Scores
Imagine the average score on a standardized test is 1100 with a standard deviation of 200. If you scored 1400, your Z-score would be:
(1400 – 1100) / 200 = 1.5
This means your score is 1.5 standard deviations above the average student.
Scenario
Raw Score (x)
Mean (μ)
Std Dev (σ)
Z-Score
Exam A
92
80
5
+2.40
Height (cm)
160
175
7
-2.14
Daily Sales
500
500
100
0.00
function calculateZScore() {
var x = parseFloat(document.getElementById('rawScore').value);
var mu = parseFloat(document.getElementById('popMean').value);
var sigma = parseFloat(document.getElementById('stdDev').value);
var resultBox = document.getElementById('resultBox');
var zOutput = document.getElementById('zOutput');
var zInterp = document.getElementById('zInterpretation');
if (isNaN(x) || isNaN(mu) || isNaN(sigma)) {
alert("Please fill in all fields with valid numbers.");
return;
}
if (sigma 0) {
interpretation = "The score is " + Math.abs(roundedZ) + " standard deviations above the mean.";
} else {
interpretation = "The score is " + Math.abs(roundedZ) + " standard deviations below the mean.";
}
// Add approximate percentile (Normal Distribution CDF approximation)
var percentile = getPercentile(z);
interpretation += "Approximately " + (percentile * 100).toFixed(2) + "% of the population falls below this score.";
zInterp.innerHTML = interpretation;
}
// Standard Normal Cumulative Distribution Function approximation
function getPercentile(z) {
var t = 1 / (1 + 0.2316419 * Math.abs(z));
var d = 0.3989423 * Math.exp(-z * z / 2);
var p = d * t * (0.3193815 + t * (-0.3565638 + t * (1.781478 + t * (-1.821256 + t * 1.330274))));
if (z > 0) {
return 1 – p;
} else {
return p;
}
}