Description Usage Arguments Value Examples
chooses proper correlation method (pearson or spearman) based on normality of the tested variables.
1 | corrProper(data, y = NULL, p.adjust = NULL)
|
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. |
a list. contains the matrix and long form result of correlation matrix:
r:
the symmetric matrix of correlations
p:
two tailed probability of t for each correlation
n:
the number of sample used in this pair of correlation
method:
the correlation method used in this pair of correlation analysis. If both variables are ordinal, kendall correlation analysis will be used. If both variables are numeric and meet normality, pearson correlation analysis will be used. If either of the two variables doesn't meet normality, spearman correlation analysis will be used. If one variable is ordinal and the other is numerical ,spearman correlation analysis will be used. If either variable is factor, NA will be returned to all results.
t:
value of t-test for each correlation
se:
standard error of the correlation
cor_long:
a tibble, the long format of correlation analysis results, NA results will not be shown
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')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.