panel.qqmath.fitted: Panel function for 'qqmathFitted'

Description Usage Arguments Details Author(s) See Also Examples

Description

This is the default panel function for qqmathFitted.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
    panel.qqmath.fitted(x, 
        f.value = NULL, 
        distribution = qnorm, 
        quantile.type = 7, 
        groups = NULL, 
        subscripts = NULL, 
        fitted.args = NULL, 
        qqstyle = NULL, 
        envelope = TRUE, 
        rdist = rnorm, 
        rdist.args = NULL, 
        sig.level = 0.95, 
        mc.samples = 100, 
        seed = .Random.seed, 
        envstyle = NULL, 
        add.qqline = c("none", "lm", "lmRob"), 
        add.qqline.par, 
        id.n = 3, 
        labelargs = FALSE, 
        verbose = FALSE, ...)

Arguments

x

vector of numeric data to be plotted in this panel

f.value

Vector of probabilities at which to compute quantiles. By default, ppoints is used to pick sensible values, so you generally don't need to specify f.value. See qqmath and prepanel.qqmath.fitted for more details.

distribution

function to compute quantiles from the reference distribution. Can be a named function (e.g., qnorm), a character string containing the name of a function (e.g., "qnorm"), or an anonymous function.

quantile.type

Numeric value, passed to quantile. Controls the type of sample quantiles that will be taken from the observations x. See the help page for quantile for more detail.

groups

Standard lattice argument defining data groups. See the help page for xyplot.

subscripts

Standard lattice argument for use with groups. See the help page for xyplot.

fitted.args

This is a list of fitted parameters for the reference distribution. The user should not specify these directly. Use the distribution.fit argument to qqmathFitted to provide a function for estimating distributional parameters.

qqstyle

List of graphical parameters to use for plotting the observed and reference quantiles.

envelope

If TRUE, plot a confidence region for the Q-Q plot via simulation.

rdist

The distribution from which to draw random numbers for the confidence region simulation. It should correspond to the distribution assumed in distribution and distribution.fit. Just like distribution, rdist can be specified as a named function, a character string containing the name of a function, or an anonymous function.

rdist.args

A list containing additional arguments to the function specified in rdist (other than the parameters return by distribution.fit).

sig.level

Significance level to use for the confidence region. Default is a 95% condifence interval.

mc.samples

Number of random samples to use to construct the confidence region.

seed

Seed to use for the random number generator. If specified, .Random.seed will be set to seed prior to generation of the simulation envelopes. This is useful to do for reproducibility of results.

envstyle

List of graphical parameters to use for plotting the confidence region boundaries.

add.qqline

Controls whether a fitted line should be added to the plot. The default option, "none", does not add a line. The "lm" option adds a linear regression line (regressing observations on quantiles from the reference distribution) using "lm". The "lmRob" option adds a robust regression line, and requires the robust library.

add.qqline.par

Optional list of parameters controlling the appearance of the fitted line.

id.n

Number of outliers to label in each panel. Default is 3. Use id.n = 0 or id.n = FALSE to omit labels for outliers. The outliers that will be flagged are the id.n largest in absolute value. The labels correspond to the index of each point in the provided vector of observations.

labelargs

Controls whether the fitted distributional parameters are added to each panel. Can be a logical value or a character value. If FALSE, no labels are added. If TRUE, labels are taken from the names of rdist.args. If a character vector is provided, those strings are used to subset the names of rdist.args. The panel function panel.qqmath.fitted will prepend each label to the corresponding distributional parameter estimate, rounded to two decimal places.

labelargs is not supported when groups are used due to the difficulty of automatically producing readable labels for all groups in each panel.

The format of the labels is controlled by the lattice setting add.text, and can be influenced by changing that setting. Additional settings can be changed by passing arguments to gpar from the grid package via the ... mechanism.

verbose

If TRUE, additional debugging information will be printed.

...

Further arguments, often graphical parameters, passed to internal plotting functions and eventually on to panel.superpose, panel.xyplot, and gpar.

Details

qqmathFitted is a modified version of qqmath from Deepayan Sarkar's lattice package. It adds the ability to fit the reference distribution to the data during the plotting procedure, as well as the ability to simulation envelopes. The latter ability is based on code appearing in the function lmfmResQQPlot from the robust package maintained by Kjell Konis.

prepanel.qqmath.fitted does the actual distributional fitting for qqmathFitted. The results of the fitting are stored in the frame used by qqmathFitted so that they do not need to be recomputed by panel.qqmath.fitted.

Author(s)

Christopher G. Green christopher.g.green@gmail.com for panel.qqmath.fitted. panel.qqmath.fitted is a modified version of panel.default.qqmath from the lattice package, written by Deepayan Sarkar. The plotting code for simulation envelopes is based on code appearing in the lmfmResQQPlot function from the robust package written by Kjell Konis et al.

See Also

qqmathFitted, prepanel.qqmath.fitted, qqmath, panel.qqmath

Examples

1
    # see the examples for qqmathFitted

christopherggreen/cggmisc documentation built on May 13, 2019, 7:04 p.m.