comparisonsGraph.cgOneFactorComparisonsTable {cg}R Documentation

Create an graph of the comparisons in a cgOneFactorComparisonsTable object

Description

Creates a graph to see comparisons in a cgOneFactorComparisonsTable object

Usage

## S4 method for signature 'cgOneFactorComparisonsTable'
comparisonsGraph(compstable, cgtheme=TRUE, device="single",
 wraplength = 20, cex.comps = 0.7, ...)

Arguments

compstable

A cgOneFactorComparisonsTable object prepared by the
comparisonsTable.cgOneFactorFit method.

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 cgOneFactorOneFactorComparisonsTable 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 cgOneFactorComparisonsTable 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.

For other possible cgOneFactorComparisonsTable table slots such as accelerated failure time or unequal variance models, the model argument is not relevant, and the appropriate comparisons graph will be calculated for these model types.

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.

Details

The minimum and maximum values across all the bar ends are added inside the plot region in blue, flush against the x-axis. In two panel cases, there is a tendency to fall outside the panel area even though right justified is used for the adj parameter of functions like panel.text. The number of decimal places are determined by the digits and endptscale values in the compstable@settings slot.

Value

comparisonsGraph.cgOneFactorComparisonsTable 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

cgOneFactorComparisonsTable

Examples

data(canine)
canine.data <- prepareCGOneFactorData(canine, format="groupcolumns",
                                      analysisname="Canine",
                                      endptname="Prostate Volume",
                                      endptunits=expression(plain(cm)^3),
                                      digits=1, logscale=TRUE, refgrp="CC")
canine.fit <- fit(canine.data)

## Comparisons Tables
canine.comps0 <- comparisonsTable(canine.fit)

canine.comps1 <- comparisonsTable(canine.fit,  mcadjust=TRUE,
                                   type="allgroupstocontrol", refgrp="CC")


## Comparisons Graphs
comparisonsGraph(canine.comps0)

comparisonsGraph(canine.comps1)

comparisonsGraph(canine.comps1, cex.comps=0.9,
                 ticklabels=list(mod="add", marks=c(300, 700)))

[Package cg version 1.0-3 Index]