# qdist: Illustrated quantile calculations from distributions In mosaic: Project MOSAIC Statistics and Mathematics Teaching Utilities

## Description

Illustrated quantile calculations from distributions

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21``` ```qdist(dist = "norm", p, plot = TRUE, verbose = FALSE, invisible = FALSE, resolution = 500L, digits = 3L, xlim, ylim, return = c("values", "plot"), refinements = list(), ...) xqgamma(...) xqt(...) xqchisq(...) xqf(...) xqbinom(...) xqpois(...) xqgeom(...) xqnbinom(...) xqbeta(...) ```

## Arguments

 `dist` a character description of a distribution, for example `"norm"`, `"t"`, or `"chisq"` `p` a vector of probabilities `plot` a logical indicating whether a plot should be created `verbose` a logical `invisible` a logical `resolution` number of points used for detecting discreteness and generating plots. The default value of 5000 should work well except for discrete distributions that have many distinct values, especially if these values are not evenly spaced. `digits` the number of digits desired `xlim` x limits. By default, these are chosen to show the central 99.8% of the distribution. `ylim` y limits `return` If `"plot"`, return a plot. If `"values"`, return a vector of numerical values. `refinements` A list of refinements to the plot. See `ggformula::gf_refine()`. `...` additional arguments, including parameters of the distribution and additional options for the plot. To help with name collisions (eg `size` for binomial distributions and `shape` for gamma distributions), argument names beginning `plot_` will be renamed to remove `plot_` and passed only to the plot. The unprefixed version will used as a paramter for the the distribution.

## Details

The most general function is `qdist` which can work with any distribution for which a q-function exists. As a convenience, wrappers are provided for several common distributions.

## Value

a vector of quantiles; a plot is printed as a side effect

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```qdist("norm", seq(.1, .9, by = 0.10), title = "Deciles of a normal distribution", show.legend = FALSE, pattern = "rings") xqnorm(seq(.2, .8, by = 0.20), mean = 100, sd = 10) qdist("unif", .5) xqgamma(.5, shape = 3, scale = 4) xqgamma(.5, shape = 3, scale = 4, color = "black") xqbeta(.5, shape1 = .9, shape2 = 1.4, dlwd = 1) xqchisq(c(.25,.5,.75), df = 3) xcbinom(c(0.80, 0.90), size = 1000, prob = 0.40) # displayed as if continuous xcbinom(c(0.80, 0.90), size = 5000, prob = 0.40) xpbinom(c(480, 500, 520), size = 1000, prob = 0.48) xpbinom(c(40, 60), size = 100, prob = 0.5) xqpois(c(0.25, 0.5, 0.75), lambda = 12) xcpois(0.50, lambda = 12) xcpois(0.50, lambda = 12, refinements = list(scale_color_brewer(type = "qual", palette = 5))) ```

mosaic documentation built on May 23, 2018, 9:03 a.m.