Creates plots with lower, upper, two-tailed, and middle of the distribution shading for popular pdfs.

shade.norm(
  x = NULL,
  from = NULL,
  to = NULL,
  sigma = 1,
  mu = 0,
  tail = "lower",
  show.p = TRUE,
  show.d = FALSE,
  show.dist = TRUE,
  digits = 5,
  legend.cex = 0.9,
  shade.col = "gray",
  ...
)

shade.t(
  x = NULL,
  from = NULL,
  to = NULL,
  nu = 3,
  tail = "lower",
  show.p = TRUE,
  show.d = FALSE,
  show.dist = TRUE,
  digits = 5,
  legend.cex = 0.9,
  shade.col = "gray",
  ...
)

shade.F(
  x = NULL,
  from = NULL,
  to = NULL,
  nu1 = 1,
  nu2 = 5,
  tail = "lower",
  show.p = TRUE,
  show.d = FALSE,
  show.dist = TRUE,
  prob.to.each.tail = 0.025,
  digits = 5,
  legend.cex = 0.9,
  shade.col = "gray",
  ...
)

shade.chi(
  x = NULL,
  from = NULL,
  to = NULL,
  nu = 1,
  tail = "lower",
  show.p = TRUE,
  show.d = FALSE,
  show.dist = TRUE,
  prob.to.each.tail = 0.025,
  digits = 5,
  legend.cex = 0.9,
  shade.col = "gray",
  ...
)

Arguments

x

A quantile, i.e. \(X = x\), or if tail = "two.custom" ins shade.norm, a two element vector specifying the upper bound of the lower tail and the lower bound of the upper tail.

from

To be used with tail = "middle"; the value a in \(P(a < X < b)\).

to

To be used with tail = "middle"; the value b in \(P(a < X < b)\).

sigma

Standard deviation for the nomral distribution.

mu

Mean of the normal distribution.

tail

One of four possibilities: "lower" provides lower tail shading, "upper" provides upper tail shading, "two" provides two tail shading, and "middle" provide shading in the middle of the pdf, between "from" and "to". The additional option "two.custom" is allowed for shade.norm. This allows calculation of asymmetric two tailed probabilities. It requires that the argument x is a two element vector with elements denoting the upper bound of the lower tail and the lower bound of the upper tail. For discrete pdfs (binomial and Poisson) the possibility "X=x" is also allowed, and will be equivalent to the density. Two tailed probability is not implemented for shade.poi.

show.p

Logical; indicating whether probabilities are to be shown.

show.d

Logical; indicating whether densities are to be shown.

show.dist

Logical; indicating whether parameters for the distribution are to be shown.

digits

Number of digits to be reported in probsabilities and densities.

legend.cex

Character expansion for legends in plots.

shade.col

Color of probability shading.

...

Arguments to be passed to methods, such as graphical parameters (see par).

nu

Degrees of freedom.

nu1

Numerator degrees of freedom for the F-distribution.

nu2

Denominator degrees of freedom for the F-distribution.

prob.to.each.tail

Probability to be apportioned to each tail in the F and Chi-square distributions if tail = "two".

Author

Ken Aho