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.
1 2 3  ## S4 method for signature 'cgOneFactorFit'
comparisonsTable(fit, type="pairwisereflect",
alpha=0.05, addpct=FALSE, display="print", ...)

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 
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.
Creates an object of class cgOneFactorComparisonsTable
, with the
following slots:
ols.comprs
The table of comparisons based on the
olsfit
component of the cgOneFactorFit
,
unless model="rronly"
is specified. In that case the slot
value is NULL
. Will not be appropriate in
the case where a valid aftfit
component is present in the
cgOneFactorFit
object. See below for the data frame structure
of the table.
rr.comprs
The table of comparisons based on the
rrfit
component of the cgOneFactorFit
object, if a valid resistant & robust fit object is present.
If rrfit
is a simple character value of
"No fit was selected."
, or model="olsonly"
was
specified, then the value is NULL
. See below for the data frame structure
of the table.
aft.comprs
The table of comparisons based on the
aftfit
component of the cgOneFactorFit
object if a valid accelerated failure time fit object is present.
If aftfit
is a simple character value of
"No fit was selected."
, then the value is NULL
.
See below for the data frame structure
of the table.
uv.comprs
The table of comparisons based on the
uvfit
component of the cgOneFactorFit
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
, and addpct
. These are used
for the print.cgOneFactorComparisonsTable
method,
invoked for example when
display="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 the
fit
object, this will be backtransformed to a percent
difference scale.
se
The estimated standard error of the difference
estimate
. If settings$endptscale=="log"
in the
fit
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 * (1alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
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 * (1alpha
) % confidence limit of the
difference estimate
. With the default alpha=0.05
,
this is 95%. If settings$endptscale=="log"
in the
fit
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
or geomeanA
The estimated mean for the
left hand side "A" of the A vs. B comparison.
If settings$endptscale=="log"
in the
fit
object, this is a backtransform to the original scale,
and therefore is a geometric mean, and will be labelled
geomeanA
.
Otherwise it is the arithmetic mean and labelled meanA
.
seA
The estimated standard error of the meanA
estimate
. If settings$endptscale=="log"
in the
fit
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
or geomeanB
The estimated mean for the
right hand side "B" of the A vs. B comparison.
If settings$endptscale=="log"
in the
fit
object, this is a backtransform to the original scale,
and therefore is a geometric mean, and will be labelled
geomeanB
.
Otherwise it is the arithmetic mean and labelled meanB
.
seB
The estimated standard error of the meanB
estimate
. If settings$endptscale=="log"
in the
fit
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.
Contact cg@billpikounis.net for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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.
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)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.