This is a sample report We completed this in class and I will be publshing this on RPubs. The data source is the DAAG package. I am using the ais dataset. The first six records are shown below.
## rcc wcc hc hg ferr bmi ssf pcBfat lbm ht wt sex sport
## 1 3.96 7.5 37.5 12.3 60 20.56 109.1 19.75 63.32 195.9 78.9 f B_Ball
## 2 4.41 8.3 38.2 12.7 68 20.67 102.8 21.30 58.55 189.7 74.4 f B_Ball
## 3 4.14 5.0 36.4 11.6 21 21.86 104.6 19.88 55.36 177.8 69.1 f B_Ball
## 4 4.11 5.3 37.3 12.6 69 21.88 126.4 23.66 57.18 185.0 74.9 f B_Ball
## 5 4.45 6.8 41.5 14.0 29 18.96 80.3 17.64 53.20 184.6 64.6 f B_Ball
## 6 4.10 4.4 37.4 12.5 42 21.04 75.2 15.58 53.77 174.0 63.7 f B_Ball
Here is a histrogram of weights for athetes showing the theoretical normal distriubtion fitted to the data and the best fitting distribution from the sample.
hist(wt, freq=F)
lines(seq(40, 120, by=.5),
dnorm(seq(40,120,by=.5),
mean(wt), sd(wt)),
lwd=2, col="blue")
lines(density(wt), lwd = 4, col="red")