Distributions in R
The normal distribution family is one of many distribution families baked into R. Dealing with these families is intuitive. Follow these guidelines:
- Begin with the distribution family’s name in R (norm for the normal family, for example).
- To the beginning of the family name, add
dto work with the probability density function. For the probability density function for the normal family, then, it’s
- For the cumulative density function (cdf?), add
p (pnorm(), for example).
- For quantiles, add
q (qnorm(), which in mathematical terms is the inverse of the cdf?).
- To generate random numbers from a distribution, add
rnorm()generates random numbers from a member of the normal distribution family.
If you supply values for μ (the mean), Σ (the standard deviation), and x (a score), the equation gives you back a value for f(x), the height of the normal distribution at x. π and e are important constants in mathematics: π is approximately 3.1416 (the ratio of a circle’s circumference to its diameter); e is approximately 2.71828. It’s related to something called natural logarithms and to numerous other mathematical concepts.