panel.qqmathci: Q-Q Diagram Confidence Intervals Panels

View source: R/panel.qqmathci.R

panel.qqmathciR Documentation

Q-Q Diagram Confidence Intervals Panels

Description

Panel function to go along with lattice::qqmath() and lattice::panel.qqmathline(). Adds filled confidence bands to the Q-Q-plot.

Usage

panel.qqmathci(
  x,
  y = x,
  distribution = qnorm,
  probs = c(0.25, 0.75),
  qtype = 7,
  groups = NULL,
  ci = 0.95,
  alpha = 0.25,
  col = trellis.par.get("plot.line")$col,
  ...,
  col.line
)

Arguments

x

The original sample, possibly reduced to a fewer number of quantiles, as determined by the f.value argument to qqmath

y

an alias for x for backwards compatibility

distribution

quantile function for reference theoretical distribution.

probs

numeric vector of length two, representing probabilities. Corresponding quantile pairs define the line drawn.

qtype

the type of quantile computation used in quantile

groups

optional grouping variable. If non-null, a line will be drawn for each group.

ci

Confidence level

alpha

Alpha level for the color fill

col

Color fill for the confidence bands.

...

Arguments passed to lattice::panel.superpose() and lattice::panel.polygon()

col.line

Color fill for the confidence bands. Is used internally by lattice::panel.superpose() and should generally not be changed.

Details

The function tries to figure out the density function counterpart to that provided in the argument distribution by regular expressions.

Value

Augments a trellis plot panel, such as that created by lattice::qqmath(), with confidence levels.

Author(s)

Johan Larsson.

See Also

lattice::panel.qqmathline(), lattice::qqmath(), and lattice::panel.qqmath().

Examples

qqmath(~ height | voice.part, aspect = "xy", data = singer,
       prepanel = prepanel.qqmathline,
       panel = function(x, ...) {
         panel.qqmathci(x, ...)
         panel.qqmathline(x, ...)
         panel.qqmath(x, ...)
       })

tactile documentation built on May 31, 2023, 9:47 p.m.