HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
The mode is a type of average value, which describes where most of the data is located
The mode is the value(s) that are the most common in the data.
A dataset can have multiple values that are modes.
A distribution of values with only one mode is called unimodal.
A distribution of values with two modes is called bimodal. In general, a distribution with more than one mode is called multimodal.
Mode can be found for both categorical and numerical data.
Here is a numerical example:
4, 7, 3, 8, 11, 7, 10, 19, 6, 9, 12, 12
Both 7 and 12 appears two times each, and the other values only once. The modes of this data is 7 and 12.
Here is a categorical example with names:
Alice, John, Bob, Maria, John, Julia, Carol
John appears two times, and the other values only once. The mode of this data is John.
The mode can easily be found with many programming languages.
Using software and programming to calculate statistics is more common for bigger sets of data, as calculating manually becomes difficult.
With Python use the statistics library multimode()
method to find the modes of the values 4,7,3,8,11,7,10,19,6,9,12,12:
from statistics import multimode
values = [4,7,3,8,11,7,10,19,6,9,12,12]
x = multimode(values)
print(x)
Using R with a user-defined function to find the modes of the values 4,7,3,8,11,7,10,19,6,9,12,12:
mode <- function(x) {
unique_values <- unique(x)
table <- tabulate(match(x, unique_values))
unique_values[table == max(table)]
}
values <- c(4,7,3,8,11,7,10,19,6,9,12,12)
mode(values)
Note: R has no built-in function to find the mode.