Code for normal distribution

The following displays R code to compute the Normal probabilities associated with the graphs at the bottom of page 1. Remember, if \(X \sim N(mu, sigma)\) and I want \(\text{Pr}(X \leq q)\), I’ll type pnorm(q, mu, sigma).

First graph

# option 1
2*pnorm(-2, 0, 1)
[1] 0.04550026
# option 2
pnorm(-2, 0, 1) + (1 - pnorm(2, 0, 1))
[1] 0.04550026

Second graph

pnorm(1, 0, 1) - pnorm(0, 0, 1)
[1] 0.3413447

Third graph

# option 1
1 - pnorm(1, 0, 1)
[1] 0.1586553
# option 2
pnorm(-1, 0, 1)
[1] 0.1586553