Measures of absolute variability deals with the dispersion of the data points. This include the following:
Example 1. The heights (in centimetres) of the 17 BS Stat students in section A23 of Statistical Inference under Dr. Supe were recorded. The data are the following: 151, 160, 162, 155, 154, 154, 153, 168, 169, 153, 158, 166, 152, 157, 150, 169, and 167. Compute the range, interquartile range, quartile deviation, average deviation, and standard deviation.
The range is computed using the function
The range returned the minimum and maximum values of the data which are 150 and 169, respectively. And for the interquartile range, the output returned is the difference between the third and first quartiles. For quartile deviation, the formula is given byQD=\frac{Q_3-Q_1}{2}
Implies,
Lastly, the mean deviationAD=\displaystyle\frac{\displaystyle\sum_{i=1}^{n}\left|X_i-\bar{X}\right|}{n-1}
And therefore, the average deviation of the heights is,
- Range -
range
; - Interquartile Range -
IQR
; - Quartile Deviation;
- Average Deviation; and,
- Standard Deviation -
sd
.
Example 1. The heights (in centimetres) of the 17 BS Stat students in section A23 of Statistical Inference under Dr. Supe were recorded. The data are the following: 151, 160, 162, 155, 154, 154, 153, 168, 169, 153, 158, 166, 152, 157, 150, 169, and 167. Compute the range, interquartile range, quartile deviation, average deviation, and standard deviation.
The range is computed using the function
range
, while the interquartile range is obtained by IQR
. Thus,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heights <- c(151, 160, 162, 155, 154, 154, 153, 168, 169, 153, 158, 166, 152, 157, 150, 169, 167) | |
range(heights) | |
[1] 150 169 | |
IQR(heights) | |
[1] 13 |
where:
- QD - quartile deviation;
- Q_3 - third quartile; and,
- Q_1 - first quartile.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QD <- function(data){ | |
IQR(data)/2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QD(heights) | |
[1] 6.5 |
where:
- AD - average deviation;
- X_i - i^{th} individual observations;
- \bar{X} - sample mean; and,
- n - total number of observations.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AD <- function(data){ | |
sum(abs(data-mean(data)))/(length(data)-1) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AD(heights) | |
[1] 6.257353 |