corrProper: Correlation Analysis with Proper Method

Description Usage Arguments Value Examples

View source: R/corrProper.R

Description

chooses proper correlation method (pearson or spearman) based on normality of the tested variables.

Usage

1

Arguments

data

a dataframe or tibble.

y

the second matrix or dataframe with the same number of rows as data.If y is provided, the correlation just between variables in data and y will be calculated. If y is not provided, pair-wise correlation between variables in data will be calculated.

p.adjust

p.adjust receive a string of holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none", which would conduct p value adjust.

Value

a list. contains the matrix and long form result of correlation matrix:

Examples

1
2
3
4
5
6
7
8
data("mtcars")
corrProper(mtcars)

#Use fdr correction
corrProper(mtcars, p.adjust = 'fdr')

#Calculate correlation between two data frames
corrProper(mtcars[1:3],mtcars[4:5], p.adjust = 'fdr')

LeiGuo0812/lightStat documentation built on June 27, 2021, 9:17 p.m.