Kurtosis is a statistical measure that describes the shape of a probability distribution or the peakedness of a dataset. It quantifies how much of the data is concentrated in the tails of the distribution compared to the center.
There are different ways to define kurtosis, but the most common definition is based on the fourth standardized moment of a distribution. The standardized moment is calculated by subtracting the mean from each data point, raising the result to the fourth power, and then taking the average of those values. Kurtosis is then obtained by dividing this fourth standardized moment by the square of the standard deviation raised to the fourth power.
Positive kurtosis indicates that the distribution has heavier tails and a sharper peak compared to the normal distribution (also known as leptokurtic distribution). Negative kurtosis, on the other hand, indicates that the distribution has lighter tails and a flatter peak compared to the normal distribution (also known as platykurtic distribution). A kurtosis value of zero means that the distribution has the same shape as the normal distribution (mesokurtic distribution).

It's important to note that kurtosis alone does not provide information about the specific shape of the distribution. For example, different distributions can have the same kurtosis value. Therefore, it's often used in conjunction with other statistical measures and graphical representations to fully understand the characteristics of a dataset.
# Install and load the moments package
install.packages("moments")
library(moments)
# Create a vector of data
data <- c(1, 2, 3, 4, 5)
# Calculate the kurtosis
kurtosis_value <- kurtosis(data)
print(kurtosis_value)
