Create a Table of Comparisons amongst Groups

Share:

Description

Create a table of comparisons based on a fit by the cg package.

Usage

1
2
comparisonsTable(fit, type = "pairwisereflect", alpha = 0.05, addpct = FALSE,
 display = "print", ...)

Arguments

fit

A fit object created with a fit method from the cg package. See specific methods.

type

Can be one of four values:

"pairwisereflect"

The default value; It calculates and lists all possible pairwise comparison permutations, as each pair order is included. In other words, Groups A vs. B and B vs. A will be included.

"pairwise"

Calculates and lists all possible pairwise comparison combinations. Once a pair such as Groups A vs. B is specified, then the reflective B vs. A is not included. So the number of comparisons is half that produced by "pairwisereflect". The ordering of group levels in the fit object is used to determine which ordering is included and which is not. If all orderings are of interest, such as for settings$endptscale=="log" in the fit object, use the "pairwisereflect" value above.

"allgroupstocontrol"

Takes the value of settings$refgrp in the cg fit object, deems it the "control" group, and constructs pairwise comparisons of all other groups to it.

"custom"

Indicates that a custom matrix of comparisons will be constructed, and that matrix needs to be specified in the contrastmatrix argument of a method.

alpha

Significance level, by default set to 0.05.

addpct

Only relevant if settings$endptscale=="original" in the fit object. An column of percent differences is added for the comparisons, as a descriptive supplement to the original scale differences that are formally estimated.

display

One of three valid values:

"print"

The default value, it calls a print method for the created ComparisonsTable object, which is a formatted text output of the table(s).

"none"

Supresses any printing. Useful, for example, when just assignment of the resulting object is desired.

"show"

Calls the default showDefault method, which will just print out the ComparisonsTable object components.

...

Additional arguments, depending on the specific method written for the object. See the method-specific documentation for additional details.

Value

A method-specific comparisonsTable object is returned. See the specific methods for discussion of return values.

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

comparisonsTable.cgOneFactorFit, comparisonsTable.cgPairedDifferenceFit.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#### One Factor data

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)

canine.comps0 <- comparisonsTable(canine.fit)

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


data(gmcsfcens)
gmcsfcens.data <- prepareCGOneFactorData(gmcsfcens, format="groupcolumns",
                                         analysisname="cytokine",
                                         endptname="GM-CSF (pg/ml)",
                                         logscale=TRUE)

gmcsfcens.fit <- fit(gmcsfcens.data, type="aft")

gmcsfcens.comps <- comparisonsTable(gmcsfcens.fit)

## Paired Difference data

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)

comparisonsTable(anorexiaFT.fit)

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