Learn R Programming

cg (version 1.0-0)

correlationTable.cgPairedDifferenceData: Compute Correlations from a cgPairedDifferenceData object

Description

Create a table of correlations of the data in a cgPairedDifferenceData object.

Usage

## S3 method for class 'cgPairedDifferenceData':
correlationTable(data, display = "print", \dots)

Arguments

data
A cgPairedDifferenceData object, typically created by prepareCGPairedDifferenceData.
display
One of three valid values: [object Object],[object Object],[object Object]
...
Additional arguments. Currently only one is valid: [object Object]

Value

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

concept

  • exploratory
  • correlation

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.

Examples

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

Run the code above in your browser using DataLab