file0.beeswax<-"Rice 3e Datasets/ASCII Comma/Chapter 10/beeswax.txt"
data.beeswax<-read.table(file=file0.beeswax,sep=",", header=TRUE)
head(data.beeswax)
## MeltingPoint Hydrocarbon
## 1 63.78 14.27
## 2 63.45 14.80
## 3 63.58 12.28
## 4 63.08 17.09
## 5 63.40 15.10
## 6 64.42 12.92
x.label="Hydrocarbon"
x=data.beeswax[,x.label]
plot(x, ylab=x.label, main="Beeswax Data (White et. al. 1960)")

plot(ecdf(x), verticals=TRUE,
col.points='blue', col.hor='red', col.vert='green',
main=paste("ECDF of Beeswax ", x.label,sep=""))

hist(x, main="Histogram (Counts)")

hist(x, main="Histogram (Density)", probability=TRUE)
grid.x<-seq(.95*min(x), 1.05*max(x), .01)
x.mean=mean(x)
x.var=var(x)
grid.x.normdensity=dnorm(grid.x, mean=x.mean, sd=sqrt(x.var))
lines(grid.x, grid.x.normdensity, col='green')

qqnorm(x)
abline(a=x.mean, b=sqrt(x.var), col='green')

list.probs=c(.10,.25,.50,.75,.9)
print(data.frame(cbind(prob=list.probs,
quantile=quantile(x,probs=list.probs))))
## prob quantile
## 10% 0.10 13.676
## 25% 0.25 14.070
## 50% 0.50 14.570
## 75% 0.75 15.115
## 90% 0.90 15.470