| comparisonsTable.cgOneFactorFit {cg} | R Documentation |
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
## 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 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.
Value
Creates an object of class cgOneFactorComparisonsTable, with the
following slots:
ols.comprsThe table of comparisons based on the
olsfitcomponent of thecgOneFactorFit, unlessmodel="rronly"is specified. In that case the slot value isNULL. Will not be appropriate in the case where a validaftfitcomponent is present in thecgOneFactorFitobject. See below for the data frame structure of the table.rr.comprsThe table of comparisons based on the
rrfitcomponent of thecgOneFactorFitobject, if a valid resistant & robust fit object is present. Ifrrfitis 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.comprsThe table of comparisons based on the
aftfitcomponent of thecgOneFactorFitobject if a valid accelerated failure time fit object is present. Ifaftfitis a simple character value of"No fit was selected.", then the value isNULL. See below for the data frame structure of the table.uv.comprsThe table of comparisons based on the
uvfitcomponent of thecgOneFactorFitobject 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.settingsA list of settings carried from the
cgOneFactorFitfitobject, and the addition of some specified arguments in the method call above:alpha,mcadjust,type, andaddpct. These are used for theprint.cgOneFactorComparisonsTablemethod, 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:
estimateThe difference in group means in the comparison: A vs. B. If
settings$endptscale=="log"in thefitobject, this will be back-transformed to a percent difference scale.seThe estimated standard error of the difference
estimate. Ifsettings$endptscale=="log"in thefitobject, 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.lowerciThe lower 100 * (1-
alpha) % confidence limit of the differenceestimate. With the defaultalpha=0.05, this is 95%. Ifsettings$endptscale=="log"in thefitobject, the confidence limit is first computed in the logarithmic scale of analysis, and then back-transformed to a percent difference scale.upperciThe upper 100 * (1-
alpha) % confidence limit of the differenceestimate. With the defaultalpha=0.05, this is 95%. Ifsettings$endptscale=="log"in thefitobject, the confidence limit is first computed in the logarithmic scale of analysis, and then back-transformed to a percent difference scale.pvalThe computed p-value from the test of the difference
estimate.meanAorgeomeanAThe estimated mean for the left hand side "A" of the A vs. B comparison. If
settings$endptscale=="log"in thefitobject, 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.seAThe estimated standard error of the
meanAestimate. Ifsettings$endptscale=="log"in thefitobject, 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.meanBorgeomeanBThe estimated mean for the right hand side "B" of the A vs. B comparison. If
settings$endptscale=="log"in thefitobject, 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.seBThe estimated standard error of the
meanBestimate. Ifsettings$endptscale=="log"in thefitobject, 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, 346-363.
Examples
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)