# How to interpret the results of the R pnorm and analogous functions?

The help for the pnorm function states:

It says that pnorm gives the "distribution function", but it seems that it gives the quantile,

for example, pnorm(q = 0, 0, 1) returns 0.5, which suggests that q=0 refers to the 50th quantile of a N(0,1). I understand what the "normal probability density function" is, but not why pnorm is called a 'distribution function'.

The R help says that the q argument is a "vector of quantiles", but it appears in practice that q represents an observed value.

What I want to know is, if I observe '2', what does pnorm(2) say about my assumption that it came from a N(0,1) distribution?

• Not all distributions have a density function. All of them have a cumulative distribution function (CDF), which thereby deserves to be called "distribution function." Everything else can be derived from it. In particular, its inverse is the quantile function. – whuber Jun 29 '12 at 20:48
• The statement "R help says that the q argument is a vector of probabilities ..." is incorrect. The documentation under ?pnorm clearly says that the argument q is a vector of quantiles. – atiretoo - reinstate monica Jun 30 '12 at 21:28
• @atiretoo I have fixed this typo, but I am still confused about why pnorm(q=2) would work if q is a quantile. – Abe Jul 6 '12 at 20:19
• A percentile is a value of a variable corresponding to a certain percent (which is a value of the cumulative distribution function). Thus the q=2 in an expression like pnorm(q=2) refers to a value of a standard normal distribution. The result, 0.977 = 97.7%, says that 97.7% of a normal distribution lies at or below $2$. – whuber Jul 6 '12 at 20:48
• What is 50th quantile? Median? If so 0.5 is definitely not the median of $N(0,1)$ distribution. – mpiktas Jul 9 '12 at 13:59

pnorm is giving you the cumulative probability distribution at a specified value of $x$. This is the cumulative probability for a standard normal distribution. So in your example the quantity I call $x$ is specified as $0$ and $0.5$ as the answer is $P[X\leq 0]$ for a random variable $X$ with a $N(0,1)$ distribution.If you took $x=1.96$ you would get $0.975$ because a standard normal distribution has probability $0.025$ in the upper right tail above $1.96$.
• So, if I want to calculate the two-tailed probability of observing x from a standard normal, it would be ifelse(pnorm(x) > 0.5, 2*(1-pnorm(x)), 2*pnorm(x))? I was hoping for something a little more straight forward; perhaps that there is another base function for that. – Abe Jun 29 '12 at 21:09
• Michael: your 2*(1-pnorm(x)) only makes sense for non-negative $x$ – Henry Jun 29 '12 at 22:47
• as @Henry points out, it should be 2*(1-pnorm(abs(x))) or 2*pnorm(-abs(x)) – Macro Jun 29 '12 at 22:50
• Or 2*pnorm(abs(x),lower=FALSE) ... all of these come up with the same answer. The answer by @Abe is less efficient because it calls pnorm 3 times to get the same result. I wonder if the OP regards 'the two tailed probability of observing abs(x) or greater as the answer to "what does pnorm(2) say about my assumption ..."? A strict answer to the question as posed is nothing. – atiretoo - reinstate monica Jun 30 '12 at 21:35
• @Macro: Your second version should be much, much more accurate if the absolute value of $x$ is of any appreciable size. – cardinal Jul 2 '12 at 18:14