Common measure of variability are the variance and standard deviation, the range, the interquartile range (IQR), and the mean absolute deviation.

Using the Boston data from package MASS, medv is the median value of owner-occupied homes in \$1000s.

setwd("~/Desktop/R/Statistics With R Blog/")
library(MASS)

var(Boston$medv)
## [1] 84.58672
sd(Boston$medv)
## [1] 9.197104
range(Boston$medv)
## [1]  5 50
IQR(Boston$medv)
## [1] 7.975
mad(Boston$medv)
## [1] 5.9304
boxplot(Boston$medv)
plot of chunk unnamed-chunk-2