comparisonsTable.cgPairedDifferenceFit {cg} | R Documentation |
Create a table of comparisons between two groups with the cgPairedDifferenceFit object
Description
Create a table of comparisons based on the cgPairedDifferenceFit object. A cgPairedDifferenceComparisonsTable class object is created.
Usage
## S4 method for signature 'cgPairedDifferenceFit'
comparisonsTable(fit, type="pairwisereflect",
alpha=0.05, addpct=FALSE, display="print", ...)
Arguments
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:
|
Value
Creates an object of class cgPairedDifferenceComparisonsTable
, with the
following slots:
ols.comprs
The table of comparisons based on the
olsfit
component of thecgPairedDifferenceFit
, unlessmodel="rronly"
is specified. In that case the slot value isNULL
. See below for the data frame structure of the table.rr.comprs
The table of comparisons based on the
rrfit
component of thecgPairedDifferenceFit
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.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
, andaddpct
. These are used for theprint.cgPairedDifferenceComparisonsTable
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 back-transformed 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 back-transformed 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 back-transformed to a percent difference scale.pval
The computed p-value 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 back-transform 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 back-transform 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. This is only possible for
the model=="ols"
case, since the original arithmetic means
are not estimated in the Resistant & Robust model=="rr"
case.
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]
Examples
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)