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

Description Usage Arguments Value Author(s) Examples

View source: R/multi.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 a separate dataset.

Usage

1
2
multi.cor.var.compare(variable, data1, data2, sample_col, group,
  ordered = "fisher")

Arguments

variable

character string indicating the variable of interest for differential correlation (within data1)

data1

first dataframe containing variable of interest

data2

second dataframe containing variable to compare

sample_col

character string defining the sample or identifying column in both datasets (common to both dataframes)

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), associated p-values, fisher r-to-z statistic and BH p-value correlation 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
7
## Load example dataframes
df1 <- read.csv("example_data/excorr_df1.csv")
df2 <- read.csv("example_data/excorr_df2.csv")

## Run function
multi.cor.var.compare(variable = "NTRpFI", df1, df2, sample_col = "sample", group = "sex")
multi.cor.var.compare(variable = "NTRpFI", df1, df2, sample_col = "sample", group = "sex", ordered = "fisher")

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