Enter your data points, separated by commas, below.
Average Deviation
—
What is Average Deviation?
Average Deviation (also known as Mean Absolute Deviation or MAD) is a measure of variability in a dataset. It quantifies the average distance of each data point from the mean (average) of the dataset. Unlike standard deviation, which squares the differences from the mean, average deviation uses the absolute value of these differences. This makes it a simpler measure to understand and calculate, though it is less sensitive to outliers than standard deviation.
In essence, average deviation tells us, on average, how far away each number in a set is from the center of that set. A smaller average deviation indicates that the data points are clustered closely around the mean, suggesting low variability. A larger average deviation indicates that the data points are more spread out, suggesting high variability.
How to Calculate Average Deviation
Calculating the average deviation involves several straightforward steps:
Step 1: Calculate the Mean (Average)
Sum all the data points and divide by the total number of data points.
Mean (x̄) = (Σx) / n
Where Σx is the sum of all data points and n is the number of data points.
Step 2: Calculate the Absolute Deviation for Each Data Point
Subtract the mean (calculated in Step 1) from each individual data point. Then, take the absolute value of each difference. The absolute value means you ignore the sign (e.g., |-5| = 5).
Absolute Deviation = |x – x̄|
Where x is an individual data point and x̄ is the mean.
Step 3: Calculate the Average of the Absolute Deviations
Sum all the absolute deviations calculated in Step 2 and divide by the total number of data points.
Average Deviation = (Σ|x – x̄|) / n
Use Cases for Average Deviation
Average deviation is a useful statistical tool in various fields:
Quality Control: To measure the consistency of a manufacturing process. If the average deviation of product measurements is small, the process is considered consistent.
Finance: To understand the dispersion of stock prices or returns around their average.
Forecasting: To assess the accuracy of predictions by measuring the average difference between forecasted values and actual outcomes.
Data Analysis: As a simple measure of data spread, especially when dealing with data that might have outliers and where standard deviation's squaring effect is undesirable.
Education: To understand the spread of student scores on a test.
While standard deviation is more commonly used in advanced statistics due to its mathematical properties, average deviation provides an intuitive and easily interpretable measure of data spread.
function calculateAverageDeviation() {
var dataPointsInput = document.getElementById("dataPoints").value;
var resultDiv = document.getElementById("averageDeviationResult");
if (!dataPointsInput) {
resultDiv.innerHTML = "Please enter data points.";
return;
}
var dataPointsArray = dataPointsInput.split(',')
.map(function(item) { return parseFloat(item.trim()); })
.filter(function(item) { return !isNaN(item); });
if (dataPointsArray.length === 0) {
resultDiv.innerHTML = "No valid numbers found.";
return;
}
var n = dataPointsArray.length;
// Step 1: Calculate the Mean
var sum = 0;
for (var i = 0; i < n; i++) {
sum += dataPointsArray[i];
}
var mean = sum / n;
// Step 2: Calculate the Absolute Deviations
var absoluteDeviations = [];
for (var i = 0; i < n; i++) {
absoluteDeviations.push(Math.abs(dataPointsArray[i] – mean));
}
// Step 3: Calculate the Average of Absolute Deviations
var sumAbsoluteDeviations = 0;
for (var i = 0; i < absoluteDeviations.length; i++) {
sumAbsoluteDeviations += absoluteDeviations[i];
}
var averageDeviation = sumAbsoluteDeviations / n;
resultDiv.innerHTML = averageDeviation.toFixed(4); // Display with 4 decimal places
}