Create a table of comparisons based on the cgPairedDifferenceFit object. A cgPairedDifferenceComparisonsTable class object is created.
1 2 3  ## S4 method for signature 'cgPairedDifferenceFit'
comparisonsTable(fit, type="pairwisereflect",
alpha=0.05, addpct=FALSE, display="print", ...)

fit 
An object of class 
type 
Can be one of two values:

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

... 
Additional arguments. Only one is currently valid:

Creates an object of class cgPairedDifferenceComparisonsTable
, with the
following slots:
ols.comprs
The table of comparisons based on the
olsfit
component of the cgPairedDifferenceFit
,
unless model="rronly"
is specified. In that case the slot
value is NULL
. See below for the data frame structure
of the table.
rr.comprs
The table of comparisons based on the
rrfit
component of the cgPairedDifferenceFit
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.
settings
A list of settings carried from the
cgPairedDifferenceFit
fit
object, and the addition
of some specified arguments in the method call above:
alpha
,
type
, and addpct
. These are used
for the print.cgPairedDifferenceComparisonsTable
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. This is only possible for
the model=="ols"
case, since the original arithmetic means
are not estimated in the Resistant & Robust model=="rr"
case.
Contact cg@billpikounis.net for bug reports, questions, concerns, and comments.
Bill Pikounis [aut, cre, cph], John Oleynick [aut], Eva Ye [ctb]
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  data(anorexiaFT)
## log scale
anorexiaFT.data < prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns",
analysisname="Anorexia FT",
endptname="Weight",
endptunits="lbs",
expunitname="Patient",
digits=1,
logscale=TRUE)
anorexiaFT.fit < fit(anorexiaFT.data)
anorexiaFT.comps < comparisonsTable(anorexiaFT.fit, display="none")
print(anorexiaFT.comps)
comparisonsTable(anorexiaFT.fit, model="olsonly")
comparisonsTable(anorexiaFT.fit, model="rronly")
## original scale evaluation
anorexiaFT.orig.data < prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns",
analysisname="Anorexia FT",
endptname="Weight",
endptunits="lbs",
expunitname="Patient",
digits=1,
logscale=FALSE)
anorexiaFT.orig.fit < fit(anorexiaFT.orig.data)
comparisonsTable(anorexiaFT.orig.fit)
comparisonsTable(anorexiaFT.orig.fit, addpct=TRUE)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.