For our example we redo Example 3.5 in the Textbook (Moore)
pnorm
(on-line help)
does directlook-up for normal distributions.
area to the left of z, as in the first line.
area to the right of z, as in the second and third lines, you must use the complement rule (subtract from one).
lower.tail = FALSE
,
which works
better when the result is very, very small (less than 10^{-16}),
for example, compare
1 - pnorm(10) pnorm(10, lower.tail = FALSE)
where the correct answer is given by the latter and the former gives infinite relative error (the correct answer is very small but not exactly zero). Of course, you may not care about the difference, in which case either is o. k.
as in the last line.
Inverse look-up, which the book calls backward
look-up (p. 72)
or finding a value given a proportion
(p. 71)
is like playing Jeopardy
(given the answer find the question). If we write
then the preceding section is about given b find p (and related questions) and this section is about given p find b (and related questions).
The following box answers the following two questions
qnorm
(on-line help)
does inverselook-up for normal distributions.
area to the leftto
area to the right, either use optional argument
lower.tail = FALSE
or convert it to an area to the leftproblem using the fact that the area under any density curve is one, so if we have 0.25 to the right of z we have 0.75 to the left of z.
The best way to do this problem is to convert it to one of the others. Question: what is the symmetric interval that has probability 0.95? If we have 0.95 in the interval, then we have 0.05 outside the interval (because the area under any density curve is one), and each of the tails outside the interval have probability 0.025 (by symmetry).
Hence qnorm(0.025)
looks up − a
and qnorm(0.025, lower.tail = FALSE)
looks up a.
The methodology for looking up in tables involves standardization and unstandardization, because we have only a table of the standard normal distribution. With R, those steps are unnecessary. It is as if R has tables for all normal distributions. Don't bother with the standardization and unstandardization.
This is Example 3.6 in the book. The question stripped of everything irrelevant to the calculation is: for a (general) normal distribution with mean 170 and SD 30 what is the probability to the right of 240?
The book is wrong. It says the answer is 0.0099 but R says the answer is 0.0098. Close enough for homework, I suppose.
This is Example 3.7 in the book. The question stripped of everything irrelevant to the calculation is: for a (general) normal distribution with mean 170 and SD 30 what is the probability between 170 and 240 (for the interval 170 < x < 240)?
The book is wrong again. It says the answer is 0.4901 but R says the answer is 0.4902. Close enough for homework, I suppose.
This is Example 3.8 in the book. The question stripped of everything irrelevant to the calculation is: for a (general) normal distribution with mean 504 and SD 111 what is the x such that the probability above x is 0.10? (The book says 10% but we always convert percents to pure number to deal with them as probabilities).
The book is wrong again. It says the answer is 646.1 but R says the answer is 646.25. Close enough for homework, I suppose.
All of these inaccuracies in the book's calculations are partly due to the limitations of the tables (not enough significant figures there) and partly do to too much rounding in intermediate calculations. R just does it right with no fuss.