[This article was first published on Analysis with R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
The measure of relative variability is the coefficient of variation (CV). Unlike measures of absolute variability, the CV is unitless when it comes to comparisons between the dispersions of two distributions of different units of measurement. In R, CV is obtained using cv function of raster package (to install an R package, click here).Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Example 1. Below are the mean and standard deviation of the number of hours spent by Tonette every studying Stochastic Process Exam and the corresponding scores she got out of 100 items. Basing from this data, should one say the number of hours she spent in studying is more variable than her exam scores, or the other way around?
Variable | Mean | Standard Deviation |
Study Hours | 25 | 2.6 |
Scores | 69 | 5.3 |
To determine this, we use the function below
And thus,
Interpretation: It is very clear from the computed CV that, the study hours is more variable than the exam scores, even though the standard deviation of the scores is higher than the spent hours.
Example 2. Consider the heights (in centimetres) of 11 AB English junior students at MSU-TCTO: 151, 160, 162, 155, 154, 168, 153, 158, 157, 150, and 167. And also their corresponding weights (in kilograms): 61, 69, 73, 65, 64, 78, 63, 68, 67, 60, and 77. Compute and interpret the coefficient of variation.
Using the cv function of raster package, we have
Interpretation: The weights of the students are more variable than their heights as proven by the computed coefficient of variation.
Reference:
Asaad, Abubakar S. (2011). Simplified Biostatistics. Manila: Rex Book Store, Inc.
To leave a comment for the author, please follow the link and comment on their blog: Analysis with R.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.