corr_matrix {AnalysisLin} | R Documentation |
Correlation Matrix
Description
Column 1: Row names representing Variable 1 in the correlation test.
Column 2: Column names representing Variable 2 in the correlation test.
Column 3: The correlation coefficients quantifying the strength and direction of the relationship.
Column 4: The p-values associated with the correlations, indicating the statistical significance of the observed relationships. Lower p-values suggest stronger evidence against the null hypothesis.
The table provides valuable insights into the relationships between variables, helping to identify statistically significant correlations.
Usage
corr_matrix(
data,
type = "pearson",
corr_plot = FALSE,
sig.level = 0.01,
highlight = FALSE,
html = FALSE
)
Arguments
data |
Input dataset. |
type |
Pearson or Spearman correlation, default is Pearson. |
corr_plot |
Generate a correlation matrix plot, default is false. |
sig.level |
Significant level. Default is 0.01. |
highlight |
Highlight p-value(s) that is less than sig.level, default is FALSE |
html |
Whether the output should be in HTML format,used when knitting into HTML. Default is FALSE. |
Value
A data frame which contains row names, column names, correlation coefficients, and p-values.
A plot of the correlation if corrplot is set to be true.
Examples
data(mtcars)
corr_matrix(mtcars, type = 'pearson')