variance_vis: Variance Visualization

View source: R/variance_vis.R

variance_visR Documentation

Variance Visualization

Description

This function is adapted from Bruce Dudek's Shiny app available here: https://shiny.rit.albany.edu/stat/visualizess/

Usage

variance_vis(
  x,
  plot_mean = TRUE,
  plot_deviances = TRUE,
  plot_deviances_x = FALSE,
  plot_deviances_y = FALSE,
  plot_population_variance = TRUE,
  plot_sample_variance = FALSE,
  plot_population_sd = FALSE,
  plot_sample_sd = FALSE,
  point_size = 3,
  variance_position = "top",
  deviation_col = "blue",
  sample_variance_col = "green",
  population_variance_col = "orange",
  sample_sd_col = "darkgreen",
  population_sd_col = "darkorange",
  sd_size = 1.5,
  xlab = "",
  ...
)

Arguments

x

a vector of values to display the variance of.

plot_mean

whether to plot the mean.

plot_deviances, plot_deviances_x, plot_deviances_y

either a logical (TRUE to include all cross products) or an integer vector indicating which cross products from x are to be plotted.

plot_population_variance

whether to plot the population variance.

plot_sample_variance

whether to plot the sample variance.

plot_population_sd

whether to plot the population standard deviation.

plot_sample_sd

whether to plot the sample standard deviation.

point_size

the size of points.

variance_position

where to plot the sample and/or population variances. Values can be 'top', 'bottom', or 'middle'.

deviation_col

color of the deviations.

sample_variance_col

color of the sample variance.

population_variance_col

color of the population variance.

sample_sd_col

color of the sample standard deviation.

population_sd_col

color of the population standard deviation.

sd_size

size of the standard deviation error bars.

xlab

label for the x-axis.

...

currently not used.

Value

a ggplot2 expression.

Author(s)

Jason Bryer

Bruce Dudek

Examples

	x <- c(97.88, 107.91, 88.26, 115.21, 87.38)
	variance_vis(x)

jbryer/VisualStats documentation built on Feb. 27, 2025, 6:19 p.m.