1.6 Summary of useful R functions relating to univariate distributions

Table 1.1 summarizes the different functions relating to univariate PMFs and PDFs, using the Binomial and Normal as examples.

TABLE 1.1: Important R functions relating to two univariate distributions, the Binomial and the Normal. In the table, prob represents probability and ranges from 0 to 1. \(P(y)\) is the probability of observing \(y\); \(F(y)\) is the cumulative distribution function (CDF); and \(F^{-1}(prob)\) is the inverse of the CDF.
Discrete Continuous
Example: Binomial(n,\(\theta\)) Normal(\(\mu,\sigma\))
Likelihood function dbinom dnorm
Probability: \(P(Y=y)\) dbinom always 0
CDF, \(F(y)=P(Y\geq y)=prob\) pbinom pnorm
Inverse CDF, \(F^{-1}(prob)=y\) qbinom qnorm
Generate simulated data rbinom rnorm

Other distributions, such as the t-distribution, the Uniform, Exponential, Gamma, Beta, etc., have their own set of d-p-q-r functions in R.