correlationTable.cgPairedDifferenceData {cg} | R Documentation |
Compute Correlations from a cgPairedDifferenceData object
Description
Create a table of correlations of the data in a
cgPairedDifferenceData
object.
Usage
## S4 method for signature 'cgPairedDifferenceData'
correlationTable(data, display = "print", ...)
Arguments
data |
A |
display |
One of three valid values:
|
... |
Additional arguments. Currently only one is valid:
|
Details
The returned table contains correlations between the paired samples. The
Pearson and Spearman methods are applied with the
cor.test
function from the core stats package.
If the logscale
option is specified (either explicitly, or implicitly
from the cgPairedDifferenceData
object), then the Pearson
calculation on the log transformed data is added.
Value
Creates an object of class cgPairedDifferenceCorrelationTable
, with the
following slots:
contents
The table of correlations for the paired differences. See below for the data frame structure of the table.
settings
A list of settings carried from the
cgPairedDifferenceData
data
object. These are used for theprint.cgPairedDifferenceCorrelationTable
method, invoked for example whendisplay="print"
.
The data frame structure of the correlation table in a contents
slot consists of row.names
that specify the correlation method:
Pearson
, and Spearman
if original
(i.e. logscale=FALSE
),
and Pearson Original
, Pearson Log
, and Spearman
if logscale=TRUE
. The header label for the column of calculated
correlations is correlation
.
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)
anorexiaFT.data <- prepareCGPairedDifferenceData(anorexiaFT, format="groupcolumns",
analysisname="Anorexia FT",
endptname="Weight",
endptunits="lbs",
expunitname="Patient",
digits=1, logscale=TRUE)
correlationTable(anorexiaFT.data)
## Show only correlations computed on original scale
correlationTable(anorexiaFT.data, logscale=FALSE)