Learn R Programming

cg (version 0.9.0)

comparisonsTable: Create a Table of Comparisons amongst Groups

Description

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

Usage

comparisonsTable(fit, mcadjust = FALSE, type = "pairwisereflect",
 contrastmatrix = NULL, refgrp = NULL, alpha = 0.05, addpct = FALSE,
 display = "print", ...)

Arguments

fit
A fit object created with a fit method from the cg package. The only class of object currently available is cgOneFactorFit, which is
mcadjust
Do a multiple comparisons adjustment, based on the simultaneous inference capabilities of the multcomp package. See Details below. The default value is FALSE. If mcadjust=TRUE is specified, there will be
type
Can be one of four values: [object Object],[object Object],[object Object],[object Object]
contrastmatrix
Only relevant if type="custom" is specified. In that case, a numeric matrix with the number of rows equal to the number of comparisons of interest is needed. The number of columns must be equal to the number of estimated means.
refgrp
If left at the default value of NULL, it will be set to the settings$refgrp value in the cg fit object. When set, it is deemed the "reference", or "control" group, so that pairwise compariso
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: [object Object],[object Object],[object Object]
...
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.

concept

  • comparisons
  • multiplicity

Details

When mcadjust=TRUE, a status message of "Some time may be needed as the critical point from the multcomp::summary.glht function call is calculated" is displayed at the console. This computed critical point is used for all subsequent p-value and confidence interval calculations. The multcomp package provides a unified way to calculate critical points based on the comparisons of interest in a "family". Thus a user does not need to worry about choosing amongst the myriad names of multiple comparison procedures.

References

Hothorn, T., Bretz, F., Westfall, P., Heiberger, R.M., and Schuetzenmeister, A. (2010). The multcomp package. Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.

See Also

comparisonsTable.cgOneFactorFit

Examples

Run this code
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)

Run the code above in your browser using DataLab