Quantile-Quantile (QQ) Graphs of a cgPairedDifferenceFit object

Share:

Description

Create a Q-Q Gaussian graph of the residuals of a cgPairedDifferenceFit object

Usage

1
2
## S4 method for signature 'cgPairedDifferenceFit'
qqGraph(fit, line=TRUE, cgtheme = TRUE, device = "single", ...)  

Arguments

fit

A fit object of class cgPairedDifferenceFit.

line

Add a line through the estimated 25th and 75th percentiles, when set to the default TRUE.

cgtheme

When set to the default TRUE, ensures a trellis device is active with limited color scheme. Namely, background, strip.shingle, and strip.background are each set to "white".

device

Can be one of three values:

"single"

The default, which will put all graphs on the same device page. For example, when resistant & robust and classical least squares are present and model="both" (the default), a 2 x 1 paneled graph will be created.

"multiple"

Relevant only when resistant & robust and classical least squares are present and model="both" (the default) or model="extended". In those cases, a new graphics device is generated to hold the resistant & robust version, as a single-paneled graph, and the classical least squares version is on the previous device. If model="extended", then a second new graphics device is generated to hold the unweighted resistant & robust residuals, as another single-paneled graph.

"ask"

Relevant only when resistant & robust and classical least squares are present and model="both" (the default) or model="extended". In that case, each are portrayed as a single-paneled graph, with the ask=TRUE argument specified in par so that the user input confirmation is needed before the graphs are drawn.

...

Additional arguments. One is currently valid:

model

For cgPairedDifferenceFit fit objects that have classical least squares lm() or resistant & robust rlm() fits, the following argument values are possible:

"both"

Q-Q graphs of the residuals from both the ordinary classical least squares and resistant & robust fits are plotted. This is the default when both fits are present in the cgPairedDifferenceFit object specified in the fit argument. If the resistant & robust fit is not available, this value is not relevant.

"olsonly"

Only a Q-Q graph of the residuals from the ordinary classical least squares olsfit fit is performed.

"rronly" or "rrwtdonly"

Only a Q-Q graph of the weighted residuals from the resistant and robust rrfit fit is plotted.

"rrunwtdonly"

Only a Q-Q graph of the unweighted residuals from the resistant and robust rrfit fit is plotted.

Details

The heading for the graph is taken from the cgPairedDifferenceData object, which
prepareCGPairedDifferenceData sets from its analysisname argument.

The label for the Y-axis is taken from the cgPairedDifferenceData object, which
prepareCGPairedDifferenceData sets from its endptname argument.

The number of decimal places printed in the ticks on the Y-axis is taken from the cgPairedDifferenceData object, which prepareCGPairedDifferenceData sets from its digits argument.

The minimum and maximum values from the range of the residuals are respectively labeled in the bottom and top left corners of the graph region.

Value

qqGraph.cgPairedDifferenceFit returns an invisible NULL. The main purpose is the side effect of graphing to the current device.

Note

Contact cg@billpikounis.net for bug reports, questions, concerns, and comments.

Author(s)

Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]

See Also

qqline

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(anorexiaFT)

anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns",
                                                 analysisname="Anorexia FT",
                                                 endptname="Weight",
                                                 endptunits="lbs",
                                                 expunitname="Patient",
                                                 digits=1,
                                                 logscale=TRUE)

anorexiaFT.fit <- fit(anorexiaFT.data)

qqGraph(anorexiaFT.fit)

qqGraph(anorexiaFT.fit, model="olsonly")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.