Learn R Programming

cg (version 1.0-2)

comparisonsTable.cgPairedDifferenceFit: 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

## S3 method for class 'cgPairedDifferenceFit':
comparisonsTable(fit, type="pairwisereflect",
 alpha=0.05, addpct=FALSE, display="print",  \dots)

Arguments

fit
An object of class cgPairedDifferenceFit.
type
Can be one of two values: [object Object],[object Object]
alpha
Significance level, by default set to 0.05.
addpct
Only relevant if 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.
display
One of three valid values: [object Object],[object Object],[object Object]
...
Additional arguments. Only one is currently valid: [object Object]

Value

  • Creates an object of class cgPairedDifferenceComparisonsTable, with the following slots: [object Object],[object Object],[object Object] 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: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object] 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.

concept

comparisons

Examples

Run this code
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)

Run the code above in your browser using DataLab