8.1.2 Standardizing with Z -scores

# calculate the probability P(Z<0.43) - i.e. what is the probability of standard
# normal variable taking a value less than 0.43?
pnorm(q = 0.43, mean = 0, sd = 1)
## [1] 0.6664022
#> [1] 0.666
# calculate the $Z$-score satisfying P(Z<z)=0.80 - i.e. what value is at the 80th
# percentile of a standard normal distribution?
qnorm(p = 0.8, mean = 0, sd = 1)
## [1] 0.8416212
#> [1] 0.842
# to see more options, type '?rnorm'

8.4.2 Normal approximation to the binomial distribution

# calculate the probability P(X<=39) when X has Bin(n=400, p=0.145) distribution
pbinom(q = 39, size = 400, prob = 0.145, lower.tail = TRUE)
## [1] 0.003025954
#> [1] 0.00303