ggcorrmat {ggstatsplot} | R Documentation |
Visualization of a correlation matrix
Description
Correlation matrix containing results from pairwise correlation tests.
If you want a data frame of (grouped) correlation matrix, use
correlation::correlation()
instead. It can also do grouped analysis when
used with output from dplyr::group_by()
.
Usage
ggcorrmat(
data,
cor.vars = NULL,
cor.vars.names = NULL,
matrix.type = "upper",
type = "parametric",
tr = 0.2,
partial = FALSE,
digits = 2L,
sig.level = 0.05,
conf.level = 0.95,
bf.prior = 0.707,
p.adjust.method = "holm",
pch = "cross",
ggcorrplot.args = list(method = "square", outline.color = "black", pch.cex = 14),
package = "RColorBrewer",
palette = "Dark2",
colors = c("#E69F00", "white", "#009E73"),
ggtheme = ggstatsplot::theme_ggstatsplot(),
ggplot.component = NULL,
title = NULL,
subtitle = NULL,
caption = NULL,
...
)
Arguments
data |
A data frame from which variables specified are to be taken. |
cor.vars |
List of variables for which the correlation matrix is to be
computed and visualized. If |
cor.vars.names |
Optional list of names to be used for |
matrix.type |
Character, |
type |
A character specifying the type of statistical approach:
You can specify just the initial letter. |
tr |
Trim level for the mean when carrying out |
partial |
Can be |
digits |
Number of digits for rounding or significant figures. May also
be |
sig.level |
Significance level (Default: |
conf.level |
Scalar between |
bf.prior |
A number between |
p.adjust.method |
Adjustment method for p-values for multiple
comparisons. Possible methods are: |
pch |
Decides the point shape to be used for insignificant correlation
coefficients (only valid when |
ggcorrplot.args |
A list of additional (mostly aesthetic) arguments that
will be passed to |
package , palette |
Name of the package from which the given palette is to
be extracted. The available palettes and packages can be checked by running
|
colors |
A vector of 3 colors for low, mid, and high correlation values.
If set to |
ggtheme |
A |
ggplot.component |
A |
title |
The text for the plot title. |
subtitle |
The text for the plot subtitle. Will work only if
|
caption |
The text for the plot caption. This argument is relevant only
if |
... |
Currently ignored. |
Details
For details, see: https://indrajeetpatil.github.io/ggstatsplot/articles/web_only/ggcorrmat.html
Summary of graphics
graphical element | geom used | argument for further modification |
correlation matrix | ggcorrplot::ggcorrplot() | ggcorrplot.args |
Correlation analyses
The table below provides summary about:
statistical test carried out for inferential statistics
type of effect size estimate and a measure of uncertainty for this estimate
functions used internally to compute these details
Hypothesis testing and Effect size estimation
Type | Test | CI available? | Function used |
Parametric | Pearson's correlation coefficient | Yes | correlation::correlation() |
Non-parametric | Spearman's rank correlation coefficient | Yes | correlation::correlation() |
Robust | Winsorized Pearson's correlation coefficient | Yes | correlation::correlation() |
Bayesian | Bayesian Pearson's correlation coefficient | Yes | correlation::correlation() |
See Also
grouped_ggcorrmat
ggscatterstats
grouped_ggscatterstats
Examples
set.seed(123)
library(ggcorrplot)
ggcorrmat(iris)