kurtosis {stats} | R Documentation |
real-valued random variable. In simpler terms, it indicates the extent to which the tails of the distribution
differ from those of a normal distribution.
### Key Points about Kurtosis:
1. Definition:
- Kurtosis is the fourth standardized moment of a distribution.
- It is calculated as the average of the squared deviations of the data from its mean, raised to the fourth power, standardized by the standard deviation raised to the fourth power.
2. Types of Kurtosis:
- Mesokurtic: Distributions with kurtosis similar to that of the normal distribution (kurtosis value of 3). The tails of a mesokurtic distribution are neither particularly fat nor particularly thin.
- Leptokurtic: Distributions with positive kurtosis greater than 3. These distributions have "fat tails" and a sharp peak, indicating more frequent large deviations from the mean than a normal distribution.
- Platykurtic: Distributions with kurtosis less than 3. These distributions have "thin tails" and a flatter peak, indicating fewer large deviations from the mean than a normal distribution.
3. Excess Kurtosis:
- Often, kurtosis is reported as "excess kurtosis," which is the kurtosis value minus 3. This adjustment makes the kurtosis of a normal distribution equal to 0.
- Positive excess kurtosis indicates a leptokurtic distribution, while negative excess kurtosis indicates a platykurtic distribution.
4. Interpretation:
- High kurtosis in a data set is an indicator that data has heavy tails or outliers. This can affect the performance of statistical models and methods that assume normality.
- Low kurtosis indicates that the data has light tails and lacks outliers.
5. Applications:
- In finance, kurtosis is used to describe the distribution of returns of an investment. A high kurtosis indicates a higher risk of extreme returns.
- In data analysis, kurtosis helps in understanding the shape of the data distribution and identifying potential outliers.
6. Calculation in R:
- The `kurtosis()` function in the `e1071` package can be used to calculate kurtosis in R.
- Alternatively, kurtosis can be calculated manually using the formula:
R<br /> kurtosis <- sum((data - mean(data))^4) / ((length(data) - 1) * sd(data)^4) - 3<br />
`
kurtosis is a statistical measure for understanding the shape of a data distribution, particularly the behavior
of its tails. It is widely used in various fields, including finance, data analysis, and statistics.
kurtosis(x,
type = Classical);
If x contains missings and these are not removed, the kurtosis is NA.
Otherwise, write xi for the non-missing elements of x, n for their number, μ for their mean, s for their standard deviation, and mr = ∑i (xi −μ) ^ r /n for the sample moments of order r.
Joanes and Gill (1998) discuss three methods for estimating kurtosis:
Type 1: g2 = m4/m2 ^ 2 −3. This is the typical definition used in many older textbooks. Type 2: G2 = ((n+1)*g2 +6)∗(n−1)/((n−2)(n−3)). Used in SAS and SPSS. Type 3: b2 = m4 /s ^ 4 −3 = (g2 +3)(1−1/n) ^ 2 −3. Used in MINITAB and BMDP.
Only G2 (corresponding to type = 2) is unbiased under normality.
# Example data
data <- c(2, 4, 4, 4, 5, 5, 7, 9);
# Calculate kurtosis using e1071 package
kurtosis_value <- kurtosis(data);
print(kurtosis_value);
# in different algorithm type
kurtosis(data,type =1);
# [1] -0.21875
kurtosis(data,type =2);
# [1] 0.940625
kurtosis(data,type =3);
# [1] -0.8706055
# Manual calculation of excess kurtosis
n <- length(data);
mean_data <- mean(data);
sd_data <- sd(data);
kurtosis_manual <- sum((data - mean_data)^4) / ((n - 1) * sd_data^4) - 3;
print(kurtosis_manual);