R: Measures of Skewness and Kurtosis

June 10, 2013

(This article was first published on Analysis with Programming, and kindly contributed to R-bloggers)

Skewness and kurtosis in R are available in the moments package (to install a package, click here), and these are:
  • Skewness – skewness; and,
  • Kurtosis – kurtosis.

Example 1. Mirra is interested on the elapse time (in minutes) she spends on riding a tricycle from home, at Simandagit, to school, MSU-TCTO, Sanga-Sanga for three weeks (excluding weekends). She obtain the following data: 19.09, 19.55, 17.89, 17.73, 25.15, 27.27, 25.24, 21.05, 21.65, 20.92, 22.61, 15.71, 22.04, 22.60, and 24.25. Compute and interpret the skewness and kurtosis.

Interpretation: The skewness here is -0.01565162. This value implies that the distribution of the data is slightly skewed to the left or negatively skewed. It is skewed to the left because the computed value is negative, and is slightly, because the value is close to zero. For the kurtosis, we have 2.301051 implying that the distribution of the data is platykurtic, since the computed value is less than 3. Graphical illustration of the data is in Figure 1.

Figure 1. Histogram of the Time Elapsed

Figure 1 confirms the numerical findings above, it is clear that the histogram is slightly skewed to the left, and is platykurtic. Below is the codes of the said figure,

Example 2. Simulate 10000 samples from a normal distribution with mean 55, and standard deviation 4.5, then compute and interpret the skewness and kurtosis, and plot the histogram.

Interpretation: The skewness of the simulated data is -0.008525844. This concludes that the data is close to bell shape but slightly skewed to the left. The computed kurtosis is 2.96577, which means the data is mesokurtic. Figure 2 is the histogram of the simulated data with empirical PDF.

Figure 2. Histogram of the Simulated Data

To leave a comment for the author, please follow the link and comment on their blog: Analysis with Programming.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)