Measures of variability

Exploratory Data Analysis in R

Andrew Bray

Assistant Professor, Reed College

x
76 78 75 74 76 72 74 73 73 75 74

Screen Shot 2019-08-05 at 4.21.30 PM.png

Exploratory Data Analysis in R

Screen Shot 2019-08-05 at 4.21.40 PM.png

x
76 78 75 74 76 72 74 73 73 75 74
x - mean(x)
 1.4545  3.4545  0.4545 -0.5455  1.4545 -2.5455
-0.5455 -1.5455 -1.5455  0.4545 -0.5455
sum(x - mean(x))
-1.421085e-14
sum((x - mean(x))^2)
28.72727
n <- 11
sum((x - mean(x))^2)/n
2.61157
sum((x - mean(x))^2)/(n - 1)
2.872727
var(x)
2.872727
Exploratory Data Analysis in R
x
76 78 75 74 76 72 74 73 73 75 74
sd(x) # Standard deviation
1.694912
var(x) # Variance
2.872727
summary(x)
 Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
72.00   73.50   74.00   74.55   75.50   78.00
IQR(x) # Interquartile range
2
diff(range(x)) # Range
6
Exploratory Data Analysis in R

Screen Shot 2019-08-05 at 4.21.50 PM.png

x
76 78 75 74 76 72 74 73 73 75 74
x_new
76 97 75 74 76 72 74 73 73 75 74
sd(x_new) # Was 1.69
6.987001
var(x_new) # Was 2.87
48.81818
diff(range(x_new)) # Was 6
25
IQR(x_new) # Doesn't change
2
Exploratory Data Analysis in R

Let's practice!

Exploratory Data Analysis in R

Preparing Video For Download...