Create a table of comparisons amongst groups with the cgOneFactorFit object
Description
Create a table of comparisons based on the cgOneFactorFit object. Pairwise or custom specified contrasts are estimated and tested. A cgOneFactorComparisonsTable class object is created.
Usage
1 2 3  ## S4 method for signature 'cgOneFactorFit'
comparisonsTable(fit, type="pairwisereflect",
alpha=0.05, addpct=FALSE, display="print", ...)

Arguments
fit 
An object of class 
type 
Can be one of four values:

alpha 
Significance level, by default set to 
addpct 
Only relevant if 
display 
One of three valid values:

... 
Additional arguments.
For other possible 
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 pvalue 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.
Value
Creates an object of class cgOneFactorComparisonsTable
, with the
following slots:
ols.comprs
The table of comparisons based on the
olsfit
component of thecgOneFactorFit
, unlessmodel="rronly"
is specified. In that case the slot value isNULL
. Will not be appropriate in the case where a validaftfit
component is present in thecgOneFactorFit
object. See below for the data frame structure of the table.rr.comprs
The table of comparisons based on the
rrfit
component of thecgOneFactorFit
object, if a valid resistant & robust fit object is present. Ifrrfit
is a simple character value of"No fit was selected."
, ormodel="olsonly"
was specified, then the value isNULL
. See below for the data frame structure of the table.aft.comprs
The table of comparisons based on the
aftfit
component of thecgOneFactorFit
object if a valid accelerated failure time fit object is present. Ifaftfit
is a simple character value of"No fit was selected."
, then the value isNULL
. See below for the data frame structure of the table.uv.comprs
The table of comparisons based on the
uvfit
component of thecgOneFactorFit
object if a valid unequal variances fit object is present. The error degrees of freedom for each comparison estimate and test is individually estimated with a Satterthwaite approximation. See below for the data frame structure of the table.settings
A list of settings carried from the
cgOneFactorFit
fit
object, and the addition of some specified arguments in the method call above:alpha
,mcadjust
,type
, andaddpct
. These are used for theprint.cgOneFactorComparisonsTable
method, invoked for example whendisplay="print"
.
The data frame structure of the comparisons table in a *.comprs
slot consists of row.names
that specify the comparison of the
form A vs. B, and these columns:
estimate
The difference in group means in the comparison: A vs. B. If
settings$endptscale=="log"
in thefit
object, this will be backtransformed to a percent difference scale.se
The estimated standard error of the difference
estimate
. Ifsettings$endptscale=="log"
in thefit
object, this estimate will be based on the Delta method, and will particularly begin to be a poor approximation when the standard error in the logscale exceeds 0.50.lowerci
The lower 100 * (1
alpha
) % confidence limit of the differenceestimate
. With the defaultalpha=0.05
, this is 95%. Ifsettings$endptscale=="log"
in thefit
object, the confidence limit is first computed in the logarithmic scale of analysis, and then backtransformed to a percent difference scale.upperci
The upper 100 * (1
alpha
) % confidence limit of the differenceestimate
. With the defaultalpha=0.05
, this is 95%. Ifsettings$endptscale=="log"
in thefit
object, the confidence limit is first computed in the logarithmic scale of analysis, and then backtransformed to a percent difference scale.pval
The computed pvalue from the test of the difference
estimate
.meanA
orgeomeanA
The estimated mean for the left hand side "A" of the A vs. B comparison. If
settings$endptscale=="log"
in thefit
object, this is a backtransform to the original scale, and therefore is a geometric mean, and will be labelledgeomeanA
. Otherwise it is the arithmetic mean and labelledmeanA
.seA
The estimated standard error of the
meanA
estimate
. Ifsettings$endptscale=="log"
in thefit
object, this estimate will be based on the Delta method, and will particularly begin to be a poor approximation when the standard error in the logscale exceeds 0.50.meanB
orgeomeanB
The estimated mean for the right hand side "B" of the A vs. B comparison. If
settings$endptscale=="log"
in thefit
object, this is a backtransform to the original scale, and therefore is a geometric mean, and will be labelledgeomeanB
. Otherwise it is the arithmetic mean and labelledmeanB
.seB
The estimated standard error of the
meanB
estimate
. Ifsettings$endptscale=="log"
in thefit
object, this estimate will be based on the Delta method, and will particularly begin to be a poor approximation when the standard error in the logscale exceeds 0.50.
An additional column addpct
of percent differences is added if
endptscale=="original"
and addpct=TRUE
,
as a descriptive supplement to the original scale
differences that are formally estimated.
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]
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, 346363.
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  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="GMCSF (pg/ml)",
logscale=TRUE)
gmcsfcens.fit < fit(gmcsfcens.data, type="aft")
gmcsfcens.comps < comparisonsTable(gmcsfcens.fit)

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