Sample mean and Population mean are two key statistics used to measure the central tendency within a dataset. While they seem similar, they represent averages from different sources of data:
This represents the average value calculated from a subset (sample) of a larger population. It’s an estimate of the true population mean, as collecting data from the entire population can be impractical or impossible.
x̄ = Σ(xi) / n
Where:
This represents the average value of all elements in a population. It’s the true average, but often not directly obtainable due to limitations in data collection.
μ = Σ(xi) / N
Where:
Example
Consider a dataset representing the heights (in cm) of 5 students (sample): {170, 165, 182, 178, 159}.
x̄ = (170 + 165 + 182 + 178 + 159) / 5
x̄ = 854 / 5
x̄ = 170.8 cm
μ = (total height of all 10 students) / 10
Imagine a school with 1000 students (population). Calculating the grades of every student to find the average score would be a massive undertaking. Instead, we can randomly select a smaller group of students (sample), say 50, and calculate their average grade (sample mean). This sample mean provides an estimate of how the entire student body might have performed (population mean).
Feature | Sample Mean (x̄) | Population Mean (μ) |
---|---|---|
Represents | Average of a sample | Average of the entire population |
Calculation Method | Sum of sample values divided by sample size (n) | Sum of all population values divided by population size (N) |
Use Case | Estimate population mean when complete data collection is not feasible. | Ideal scenario when data for the entire population is available. |
Here’s a Python code example demonstrating how to calculate both sample mean, and population mean:
sample_data = [85, 72, 90, 88, 65, 78, 92, 83, 87, 69, 80, 75, 95, 82, 70, 89, 68, 98, 81, 71, 91, 84, 77, 94, 86, 73, 97, 80, 74, 93, 67, 99, 79, 76, 90, 88, 66, 96, 72]
population_data = sample_data
sample_mean = sum(sample_data) / len(sample_data)
print("Sample Mean:", sample_mean)
Sample Mean: 81.64
population_data = [172, 168, 180, 176, 161, 173, 178, 166, 170, 183, 164, 174, 186, 170, 158, 175, 160, 176, 181, 165, 171, 167, 179, 174, 162, 172, 178, 163, 170, 182, 160, 173, 185, 169, 157, 174, 159, 175, 180, 164, 169, 165, 177, 172, 158, 170, 176, 161, 171, 177, 162, 168, 180, 167, 172, 178, 164, 170, 183, 159, 171, 184, 166]
population_mean = sum(population_data) / len(population_data)
print("Population Mean (if available):", population_mean)
Population Mean (height in cm): 171.24
This example highlights the distinction between sample mean and population mean using different datasets. Remember that in real-world scenarios, you might not always have access to complete population data, making sample means crucial for drawing inferences about the larger population.
By understanding the distinction between sample mean and population mean, you can effectively interpret and utilize central tendency measures in your data analysis tasks.
We hope you found the information helpful! If you learned something valuable, consider sharing it with your friends, family, and social networks.
Reference: Khan Academy
Hi, I am Vishal Jaiswal, I have about a decade of experience of working in MNCs like Genpact, Savista, Ingenious. Currently i am working in EXL as a senior quality analyst. Using my writing skills i want to share the experience i have gained and help as many as i can.
SQL Interview Question at Zomato: These questions were recently asked in interview at Zomato, you…
Introduction: SQL Indexing and Query Optimization SQL indexing is a critical concept that can drastically…
This article is about the SQL Interview Questions asked by Walmart for their Data Analyst…
You must be able to answer these SQL Interview Questions if you are applying for…
This article tackles common SQL Interview Questions asked by EY, offering detailed solutions and explanations…
1164. Product Price at a Given Date: Learn how to track and select price from…
View Comments