pnorm in R: How to Use pnorm() Function in R

The pnorm() is a built-in R function that calculates the c. d. f. where X is normal. Optional arguments described on the online documentation specify the parameters of the particular normal distribution.

pnorm in R

The pnorm() is a built-in R function that returns the value of the cumulative density function (cdf) of the normal distribution given a certain random variable q, and a population mean μ, and the population standard deviation σ.

Syntax

pnorm(q, mean, sd, lower.tail = TRUE, log.p = FALSE) 

Parameters

q: It is a vector of quantiles.

mean: It is a vector of means.

sd: It is a vector of standard deviations.

lower.tail: It is logical; if TRUE (default), probabilities are otherwise.

log, log.p: It is a logical argument.

If mean or sd are not specified, they assume the default values of 0 and 1, respectively.

Example

Find the percentage of males taller than 78 inches in a population with mean = 74 and sd = 2.

pnorm(78, mean = 74, sd = 2, lower.tail = FALSE)

Output

[1] 0.02275013

Find the percentage of otters that weight less than 33 lbs in a population with mean = 40 and sd = 8. Let’s see the following code example.

pnorm(33, mean=40, sd = 8)

Output

[1] 0.190787

The pnorm() function returns the integral from −∞ to q of the pdf of the normal distribution where q is a Z-score. Try to guess the value of pnorm(0).

pnorm(0)

Output

[1] 0.5

The pnorm() function also takes the argument lower.tail. If the lower.tail is set equal to FALSE, then pnorm returns the integral from q to ∞ the pdf of the normal distribution.

Note that pnorm(q) is the same as 1-pnorm(q, lower.tail = FALSE).

pnorm(2)

Output

[1] 0.9772499

That is it for pnorm() function in R.

See also

rnorm() function in R

dnorm() function in R

Leave a Comment