Statistics
In a given dataset, we try to summarize the data by the central position of the data, which is known as measure of central tendency or summary statistics. There are several ways to measure the central tendency, such as mean, median, and mode. Mean is the widely used measure of central tendency. Under different scenarios, we use different measures of central tendency. Now we are going to give an example of how to compute the different measures of central tendency in R.
Mean
mean
is the equal weightage average of the sample. For example, we can compute the mean of Volume
in the dataset Sampledata
by executing the following code, which gives the arithmetic mean of the volume:
mean(Sampledata$Volume)
Median
Median is the mid value of the matrix when it is arranged in a sorted way, which can be computed by executing the following code:
median(Sampledata$Volume)
Mode
Mode is the value present in the attribute which has maximum frequency. For mode, there does not exist an inbuilt function...