Learn R Programming

cg (version 1.0-3)

comparisonsGraph.cgPairedDifferenceComparisonsTable: Create an graph of the comparisons in a cgPairedDifferenceComparisonsTable object

Description

Creates a graph to see comparisons in a cgPairedDifferenceComparisonsTable object

Usage

"comparisonsGraph"(compstable, cgtheme=TRUE, device="single", wraplength = 20, cex.comps = 0.7, ...)

Arguments

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). In that case, a new graphics device is generated to hold the resistant & robust version, as a single-paneled graph. The classical least squares version is on the previous device.

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

wraplength
On the left hand axis are each A vs. B comparison label from the compstable object. An attempt at sensible formatting when a newline is needed is made, but adjustment by this argument may be needed. The default is 20 characters before wrapping to a newline.
cex.comps
Similar to wraplength, adjustment of this argument parameter can be made to fit the comparison labels on the left hand axis.
...
Additional arguments. Two are currently valid:
model
For cgPairedDifferencePairedDifferenceComparisonsTable objects that have classical least squares lm() or resistant & robust rlm() table slots, the following argument values are possible:
"both"
Graphs of Comparisons Tables based on both the ordinary classical least squares and resistant & robust slots are populated. This is the default when both slots are present in the cgPairedDifferenceComparisonsTable object specified in the compstable argument. If the resistant & robust fit is not available, this value is not relevant.

"olsonly"
Only an Comparisons Graph based on the ordinary classical least squares table slot is performed.

"rronly"
Only a Comparisons Graph based on the resistant and robust table slot is performed.

ticklabels
A list of two components:
mod
Can be either of these two values,
"replace"
Before graphing the data, remove any automatically generated tickmarks for the x-axis, and create the tickmarks specified in the marks component below.

"add"
Before graphing the data, add tickmarks specified in the marks component to the automatically generated ones.

marks
A vector of tickmarks to be placed on the x-axis. Any numeric representations will be coerced to character.

Value

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

Details

The minimum and maximum values across the bar ends are added inside the plot region in blue, flush against the x-axis. The number of decimal places are determined by the digits and endptscale values in the compstable@settings slot.

See Also

cgPairedDifferenceComparisonsTable

Examples

Run this code

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)

anorexiaFT.comps0 <- comparisonsTable(anorexiaFT.fit)
anorexiaFT.comps1 <- comparisonsTable(anorexiaFT.fit,  model="olsonly", display="none")

comparisonsGraph(anorexiaFT.comps0)
comparisonsGraph(anorexiaFT.comps1)

Run the code above in your browser using DataLab