# plotDist: Plotting of Statistical Distributions In fastGraph: Fast Drawing and Shading of Graphs of Statistical Distributions

## Description

This function plots as many as three probability density functions and cumulative distribution functions on the same graph using just one command, where the domain of the graph need not be specified by the user.

## Usage

 1 2 3 4 plotDist(distA = "dnorm", parmA1 = NULL, parmA2 = NULL, distB = NULL, parmB1 = NULL, parmB2 = NULL, distC = NULL, parmC1 = NULL, parmC2 = NULL, xlab = NULL, xmin = NULL, xmax = NULL, col = c("black", "red", "darkgreen"), is.discrete = NULL, additional.x.range = NULL, lwd = 5, ...)

## Arguments

 distA Character variable naming the first probability density function (starting with "d") or cumulative density function (starting with "p") to be graphed. parmA1 The first argument in distA, excluding the dummy argument. For example, if distA="dnorm", then parmA1 is the mean from "dnorm". Alternatively, parmA1 may be set to be a vector of arguments, excluding the dummy argument. parmA2 The second argument in distA, excluding the dummy argument. For example, if distA="dnorm", then parmA2 is the sd from "dnorm". Alternatively, parmA2 may be set to be a vector of arguments, excluding both the dummy argument and parmA1. distB Character variable naming the second probability density function (starting with "d") or cumulative density function (starting with "p") to be graphed. parmB1 The first argument in distB, excluding the dummy argument. Alternatively, parmB1 may be set to be a vector of arguments, excluding the dummy argument. parmB2 The second argument in distB, excluding the dummy argument. Alternatively, parmB1 may be set to be a vector of arguments, excluding both the dummy argument and parmB1. distC Character variable naming the third probability density function (starting with "d") or cumulative density function (starting with "p") to be graphed. parmC1 The first argument in distC, excluding the dummy argument. Alternatively, parmC1 may be set to be a vector of arguments, excluding the dummy argument. parmC2 The second argument in distC, excluding the dummy argument. Alternatively, parmC2 may be set to be a vector of arguments, excluding both the dummy argument and parmC1. xlab The label of the x variable. xmin The minimum x-value to be graphed. xmax The maximum x-value to be graphed. col A vector specifying the colors of distA, distB, and distC, respectively. is.discrete A vector with 1, 2, or 3 logical values, indicating whether or not distA, distB, and distC are discrete. For built-in density functions, such as dbinom, pbinom, dgeom, pgeom, dhyper, phyper, dpois, ppois, dnbinom, and pnbinom, this argument is.discrete can be set to NULL, which is the default. additional.x.range A vector of two additional x-values for evaluating the function. This argument would be needed only if the user is dissatified with the domain determined by the function. lwd The line width for discrete distributions. ... Optional arguments to be passed to the plot function (see par).

## Details

If only one graph is to be plotted, then use distA. If only two graphs are to be plotted, then use distA and distB.

The arguments in plotDist are typically entered as first distribution plus two parameters, second distribution plus two parameters, and third distribution plus two parameters. If only one parameter of the distribution is needed, then the second parameter can be left as the default of NULL. If three or more parameters of the distribution are needed, then the first parameter can be assigned to be a vector consisting of all of the parameters.

The defaul value of distA is "dnorm"; i.e., for plotting the normal distribution.

The default values of all of the arguments following parmC2 usually are sufficient.

## Note

This function plotDist calls functions getMinMax, plot, and curve.

## Author(s)

Steven T. Garren, James Madison University, Harrisonburg, Virginia, USA