How to Calculate Central Tendency and Asymmetry measures in Statistics and Python

In this blog, I am going to talk about Central Tendency, asymmetry and variability with hands on using Python. If you miss my previous blog about Descriptive Statistics with Python, please go to the below link.

https://arpitatechcorner.com/2020/11/23/descriptive-statistics-python/

What is Central Tendency?

In statistics, a central tendency is a central or typical value for a probability distribution.

Purpose of Central Tendency:

Β It is a single value which is the representative of an entire distributed data. There are three main measures in central tendency, mean, median and mode.

Now we are going to in detail to know about these measures.

Mean:Β 

Mean is mostly used for measuring central tendency. It is a simple average of whole data set. Formula of calculating mean of a data set is

(π‘₯1 + π‘₯2 + π‘₯3 + β‹― + π‘₯π‘βˆ’1 + π‘₯𝑁 ) /N

Where π‘₯1, π‘₯2 , π‘₯3 , β‹― ,π‘₯π‘βˆ’1 , π‘₯𝑁 => r Data values , N = Total number of sample data.

For population data, it is denoted as ΞΌ and for sample data x bar (symbol shown in above image)

Note: Mean is easily affected by outliers.

Mean Example:

Find out Mean explanation with some example.

Median

Β The median is the midpoint of the ordered dataset. . It is not affected by outliers. In an ordered dataset, the median is the number at position (n+1)/2. Here n is number of observations. If this position is not a whole number, then the median is the simple average of the two numbers at positions closest to the calculated value.

Median Example

If we consider the above data set, let’s find out median.

Mode

In a data set, the mode is the value which occurs most often. A dataset can have 0 modes, 1 mode or multiple modes. Normally, the mode is calculated by finding the value with the highest frequency.

Mode Example

Python Coding for Central Tendency Measures

Now it is time for measuring asymmetry for a data set. For this context, we need to understand skewness of a data set.

Skewness

Β Skewness is a measure of asymmetry. It indicates the observations in a dataset are concentrated on which side.

The above graph has right (positive)skewness. It means that the outliers are to the right (long tail to the right). Left (negative) skewness means that the outliers are to the left.

Normally, using different software, skewness is calculated. Formula of skewness is

Python Coding for Skewness

Conclusion

In my next blog we will learn about variability with python coding.

2 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: