In statistics, central tendency refers to a collection of summary measures that describe the typical or average value of a set of data. It helps us understand where most of the data points cluster within a distribution. There are three main measures of central tendency:
Often referred to as the “average,” it’s calculated by adding all the values in a dataset and dividing by the number of values. It’s a good measure of central tendency when the data is symmetrical and free of outliers (extreme values).
numbers = [2, 5, 10, 15, 20]
total_sum = sum(numbers)
number_of_items = len(numbers)
mean = total_sum / number_of_items
print("The mean of the list is:", mean)
The mean of the list is: 10.4
The middle value when the data is arranged in ascending or descending order. If you have an even number of data points, the median is the average of the two middle values. The median is less sensitive to outliers compared to the mean.
numbers = [2, 5, 10, 15, 20]
numbers.sort()
middle_index = len(numbers) // 2
median = (numbers[middle_index] + numbers[middle_index - 1]) / 2
print("The median of the even-sized list is:", median)
The median of the even-sized list is: 12.5
The most frequent value in a dataset. It can be useful for identifying the most common value, but it doesn’t necessarily represent the “center” of the data, especially for skewed distributions.
numbers = [2, 5, 10, 10, 15, 20]
most_frequent = max(set(numbers), key=numbers.count)
print("The mode of the list is:", most_frequent)
The mode of the list is: 10
The best measure of central tendency to use depends on the characteristics of your data:
In conclusion, central tendency is a valuable tool for summarizing and understanding the “center” of your data. By considering the characteristics of your data and choosing the appropriate measure, you can effectively represent the typical value within your dataset.
We hope you found the information helpful! If you learned something valuable, consider sharing it with your friends, family, and social networks.
Reference : Leard
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