Learn R Programming

mosaic (version 0.13.0)

pdist: Illustrated probability calculations from distributions

Description

Illustrated probability calculations from distributions

Usage

pdist(dist = "norm", q, plot = TRUE, verbose = FALSE, invisible = FALSE,
  digits = 4L, xlim, ylim, vlwd = NULL,
  vcol = trellis.par.get("add.line")$col, rot = 45, resolution = 5000L,
  ...)

xpgamma(...)

xpt(...)

xpchisq(...)

xpf(...)

xpbinom(...)

xppois(...)

xpgeom(...)

xpnbinom(...)

Arguments

dist
a character discription of a distribution, for example "norm", "t", or "chisq"
q
a vector of quantiles
plot
a logical indicating whether a plot should be created
verbose
a logical
invisible
a logical
digits
the number of digits desired
xlim
x limits
ylim
y limits
vlwd
width of vertical lines
vcol
color of vertical lines
rot
angle for rotating text indicating probability
resolution
number of points used for detecting discreteness and generating plots. The defaut value of 5000 should work well except for discrete distributions that have many distinct values, especially if these values are not evenly spaced.
...
additional arguments, including parameters of the distribution and additional options for the plot

Value

  • a vector of probabilities; a plot is printed as a side effect

Details

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

See Also

qdist, xpnorm, xqnorm.

Examples

Run this code
pdist("norm", -2:2)
pdist("norm", seq(80,120, by=10), mean=100, sd=10)
pdist("chisq", 2:4, df=3)
pdist("f", 1, df1=2, df2=10)
pdist("gamma", 2, shape=3, rate=4)

Run the code above in your browser using DataLab