cor.var.compare: Calculates differential correlation statistics between a...

Description Usage Arguments Value Author(s) Examples

View source: R/cor.var.compare.R

Description

Creates a table of pairwise correlations statistics, with separation of two groups for comparison. This can be used as an exploratory tool to investigate correlations between a specific variable of interest and all other variables within the same dataset. The significance of the difference between two correlation coefficients is ......

Usage

1
cor.var.compare(variable, data, group, ordered = "fisher")

Arguments

variable

character string defining the variable of interest for differential correlation

data

dataframe for analysis

group

character string defining the grouping variable for comparative differential correlations

ordered

character string defining which column the table should be ordered by. Choose from g1cor, g1p, g2cor, g2r, fisher (default) and BH.

Value

a table (or dataframe) with pearson correlation coefficients (r) and associated p-values between variables for each comparative group. Also gives fisher r-to-z p-value and adjusted p-value using Benjamini-Hochberg correction for each correlation pair.

Author(s)

Emily Mears, mears.emilyrose@gmail.com, Matthew Grant, mgra576@aucklanduni.ac.nz

Ben Day, benjamindayengineer@gmail.com

Examples

1
2
3
4
5
6
## Load example dataframes
df <- read.csv("example_data/excorr_df1.csv")

## Run function
cor.var.compare(variable = "NTRpFI", data = df, group = "sex")
cor.var.compare(variable = "NTRpFI", data = df, group = "sex", ordered = "fisher")

emily5/exCorr documentation built on May 22, 2020, 1:01 p.m.