Menu
×
   ❮   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

Statistics - Average


An average is a measure of where most of the values in the data are located.


The Center of the Data

The center of the data is where most of the values in the data are located. Averages are measures of the location of the center.

There are different types of averages. The most commonly used are:

Note: In statistics, averages are often referred to as 'measures of central tendency'.

For example, using the values:

40, 21, 55, 21, 48, 13, 72


Mean

The mean is usually referred to as 'the average'.

The mean is the sum of all the values in the data divided by the total number of values in the data:

(40 + 21 + 55 + 31 + 48 + 13 + 72)/7 = 38.57

Note: There are are multiple types of mean values. The most common type of mean is the arithmetic mean.

In this tutorial, 'mean' refers to the arithmetic mean.



Median

The median is the 'middle value' of the data.

The median is found by ordering all the values in the data and picking the middle value:

13, 21, 21, 40, 48, 55, 72

The median is less influenced by extreme values in the data than the mean.

Changing the last value to 356 does not change the median:

13, 21, 21, 40, 48, 55, 356

The median is still 40.

Changing the last value to 356 changes the mean a lot:

(13 + 21 + 21 + 40 + 48 + 55 + 72)/7 = 38.57

(13 + 21 + 21 + 40 + 48 + 55 + 356)/7 = 79.14

Note: Extreme values are values in the data that are much smaller or larger than the average values in the data.


Mode

The mode is the value(s) that appears most often in the data:

40, 21, 55, 21, 48, 13, 72

Here, 21 appears two times, and the other values only once. The mode of this data is 21.

The mode is also used for categorical data, unlike the median and mean. Categorical data can't be described directly with numbers, like names:

Alice, John, Bob, Maria, John, Julia, Carol

Here, John appears two times, and the other values only once. The mode of this data is John.

Note: There can be more than one mode if multiple values appear the same number of times in the data.


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.