In Section 9.1, we gave a detailed introduction to the four functions for a normal distribution, which is a popular continuous distribution. In particular, we now know that
dnorm() produces the pdf of a normal distribution. In the case of discrete distributions, however, we would have probability mass function (pmf) instead of the pdf. Let’s use the binomial distribution as a representative example of discrete distributions with the four functions as below.
||probability mass function|
||cumulative distribution function|
||random number generator|
Now, let’s look at a few other commonly used distributions. For simplicity, let’s just use the random number generator for each distribution in the following table.
As we can see from this table, all random number generator functions are formed by the letter
r followed by the name of the distribution we would like to generate from. For the other three functions, we just need to change the initial letter
dfor pdf (continuous distribution) or pmf (discrete distribution),
qfor quantile function.
Let’s do some statistical exercises with those distributions.