normal.plot <- ggplot(data=data.frame(x=c(-3,3)), aes(x)) + stat_function(fun=dnorm, args=list(mean=0, sd=1))
normal.plot + stat_function(fun=dnorm, xlim=c(-1.13, 3), geom='area')

pnorm(q=-1.13, mean=0, sd=1, lower.tail=FALSE)
## [1] 0.8707619
normal.plot + stat_function(fun=dnorm, xlim=c(-3, .18), geom='area')

pnorm(q=.18, mean=0, sd=1)
## [1] 0.5714237
normal.plot + stat_function(fun=dnorm, xlim=c(3, 3), geom='area')

pnorm(q=8, mean=0, sd=1, lower.tail=FALSE)
## [1] 6.220961e-16
normal.plot + stat_function(fun=dnorm, xlim=c(-.5, .5), geom='area')

pnorm(q=.5, mean=0, sd=1) - pnorm(q=-.5, mean=0, sd=1)
## [1] 0.3829249

Leo’s finishing time z-score is 1.08 meaning that his time is about 1 standard deviation above the mean finishing times in his group. Mary’s is 0.31 meaning that she is approximately 0.31 standard deviation above her groups finishing time.

pnorm(q=4948, mean=4313, sd=583, lower.tail=FALSE)
## [1] 0.1380342
pnorm(q=5513, mean=5261, sd=807, lower.tail=FALSE)
## [1] 0.3774186
female.heights <- c(54, 55, 56, 56, 57, 58, 58, 59, 60, 60, 60, 61, 61, 62, 62, 63, 63, 63, 64, 65, 65, 67, 67, 69, 73)
length(female.heights[female.heights > 56.94 & female.heights < 66.1]) / 25
## [1] 0.68

Z-score for 68% is -1 to 1 corresponding to a range of (56.94, 66.1)

length(female.heights[female.heights > 52.36 & female.heights < 70.69]) / 25 #96%
## [1] 0.96

Z-score for 95% is -1 to 1 corresponding to a range of (52.36, 70.69)

length(female.heights[female.heights > 47.78 & female.heights < 75.26]) / 25 #68%
## [1] 1

Z-score for 99.7% is -1 to 1 corresponding to a range of (47.78, 75.26)

qqnormsim(female.heights)

dgeom(9, .02)
## [1] 0.01667496
pgeom(100, .02)
## [1] 0.8700328
dbinom(2, 3, .51)
## [1] 0.382347
dnbinom(7, 3, .15)
## [1] 0.03895012