"comparisonsTable"(fit, type="pairwisereflect", alpha=0.05, addpct=FALSE, display="print", ...)
cgOneFactorFit
.
"pairwisereflect"
"pairwise"
"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
objects, use the "pairwisereflect"
value above.
"allgroupstocontrol"
settings$refgrp
in the cg fit
object, deems it the "control" group, and constructs
pairwise comparisons of all other groups to it. This setting is
required when the refgrp
argument is specified in the
call (see ... section below.)
"custom"
contrastmatrix
argument.
0.05
.
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.
"print"
print
method for the
created cgOneFactorComparisonsTable
object, which is
a formatted text output of the table(s).
"none"
"show"
showDefault
method, which
will just print out the cgOneFactorComparisonsTable
components.
mcadjust
FALSE
.
If mcadjust=TRUE
is specified, there will be a delay,
usually just for a few seconds, due to computing time of the
critical point in order to conduct the adjusted comparisons.
contrastmatrix
type="custom"
is
specified. In that case, a numeric matrix with the number of
rows equal to the number of comparisons of interest. The number
of columns must be equal to the number of group means. Each row in
the matrix is assumed to represent a contrast of coefficients
amongst the groups that defines the comparison of interest.
refgrp
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 comparisons of all other groups to it will be
constructed when type="allgroupstocontrol"
. Please note the
type="allgroupstocontrol"
setting is
REQUIRED when the refgrp
argument is specified in the
call with a valid non-NULL
value.
model
cgOneFactorFit
fit
objects that have
classical least squares lm
or resistant & robust
rlm
fits, the following argument values are possible:
"both"
cgOneFactorFit
object specified in the fit
argument. If the resistant & robust fit is not available,
this value is not relevant.
"olsonly"
olsfit
fit slot is performed.
"rronly"
rrfit
fit slot is performed.
For other possible cgOneFactorFit
fit components such as
accelerated failure time or unequal variance models, the model
argument is not relevant, and the appropriate comparisons table will
be calculated for these model types.
cgOneFactorComparisonsTable
, with the
following slots:ols.comprs
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
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
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
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
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"
.
*.comprs
slot consists of row.names
that specify the comparison of the
form A vs. B, and these columns:estimate
settings$endptscale=="log"
in the
fit
object, this will be back-transformed to a percent
difference scale.
se
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
alpha
) % 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 back-transformed to a percent
difference scale.
upperci
alpha
) % 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 back-transformed to a percent
difference scale.
pval
estimate
.
meanA
or geomeanA
settings$endptscale=="log"
in the
fit
object, this is a back-transform 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
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
settings$endptscale=="log"
in the
fit
object, this is a back-transform 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
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.
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.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.
multcomp
package.Hothorn, T., Bretz, F., and Westfall, P. (2008). "Simultaneous Inference in General Parametric Models", Biometrical Journal, 50, 3, 346-363.
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