mean(credits[,1])
## [1] 13.65
median(credits[,1])
## [1] 14
hist(credits[,1],col="sky blue",xlab="",,ylab="",main="College Credits")
IQR = 3rd quartile - 1st quartile
summary(credits[,1])
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 8.00 13.00 14.00 13.65 15.00 18.00
IQR(credits[,1])
## [1] 2
lower_limit = mean(credits[,1]) - 2*sd(credits[,1])
upper_limit = mean(credits[,1]) + 2*sd(credits[,1])
print(lower_limit)
## [1] 9.832179
print(upper_limit)
## [1] 17.46782
16 is within 2sd of the mean, so it is not unusual; but 18 is because it falls outside of this range.
Not at all, because these are point estimates based on samples and there isn’t much difference between 14.02 and 13.65.
The standard error is used which is sigma/sqrt(n).
sd(credits[,1])/sqrt(nrow(credits))
## [1] 0.1908911