prettyHist: Plot a sampling distribution along with a value of a...

View source: R/Plot4CATA.R

prettyHistR Documentation

Plot a sampling distribution along with a value of a criterion (e.g., for significance).

Description

prettyHist: plots a sampling distribution (typically derived from a permutation test as performed, e.g., by InPosition::epCA.inference.battery). pretyHist plots the empirical critical value and position the value of the criterion. along with a value of a criterion. User is required to provide a distribution and an observed value.

Usage

prettyHist(
  distribution,
  observed,
  show.observed = TRUE,
  observed.col = "mediumorchid4",
  xlim = c(-1.2, 1.2),
  breaks = 10,
  border = "white",
  distr.col = "darkseagreen",
  main = "",
  xlab = "",
  ylab = "",
  counts = TRUE,
  cutoffs = c(0.025, 0.975),
  show.cutoffs = TRUE,
  cutoff.col = "firebrick3",
  gray.distr = TRUE,
  tail.dir = "+"
)

Arguments

distribution

the empirical distribution (e.g., from a permutation test).

observed

the observed value of the criterion.

show.observed

if TRUE (default) plot the value of the criterion.

observed.col

a color for the criterion (default is "mediumorchid4").

xlim

default is c(-1.2, 1.2): value for the x-axis. The default works well for CA or MCA but is unlikely to work for other techniques (such as, e.g., PCA, PLS, or Hellinger analysis).

breaks

(default is 10) How many bins for the histogram of the distribution.

border

(default is "white") color for the border of the graph.

distr.col

(default is ("darksgreen") the color for the distribution.

main

(default "") the main title.

xlab

(default "") the x-axis label.

ylab

(default "") the y-axis label.

counts

if TRUE (default) shows the number of samples, if FALSE shows a probability.

cutoffs

[default is c(0.025,0.975)], the p-values (default for alpha = .05).

show.cutoffs

if TRUE (default) show the critical value(s).

cutoff.col

(default is "firebrick3") the color for the critical value.

gray.distr

if TRUE (default) distribution is plotted in gray.

tail.dir

if "+" (default) the critical value is on the right of the distribution, otherwise it is on the left.

Value

h the histogram of the distribution

Author(s)

Derek Beaton & Hervé Abdi


HerveAbdi/PTCA4CATA documentation built on July 17, 2022, 5:41 a.m.