Learn R Programming

TOSTER (version 0.8.3)

plot_cor: Plot correlation coefficients

Description

[Stable]

Function to produce plots of the distribution of standard correlation coefficients.

Usage

plot_cor(
  r,
  n,
  method = c("pearson", "spearman", "kendall"),
  type = c("c", "cd"),
  levels = c(0.68, 0.9, 0.95, 0.999)
)

Value

Returns plot of the distribution of the correlation coefficient.

Arguments

r

The observed correlation coefficient.

n

Total number of observations (sample size).

method

The method by which the coefficient was calculated: pearson, spearman, or kendall (default is "pearson")

type

Choose whether to plot a "consonance" function ("c"), consonance density ("cd"), or both (c("c","cd"); default option).

levels

Numeric vector of confidence levels to display

Details

This function was created so that users could create consonance plots of Pearson's correlation coefficient. These types of plots are discussed by Schweder T, Hjort NL. (2016, ISBN:9781316445051) and Rafi Z, Greenland S. (2020) doi:10.1186/s12874-020-01105-9.

See Also

Other Correlations: boot_cor_test(), corsum_test(), power_z_cor(), z_cor_test()

Other plotting functions: plot_pes(), plot_smd()