Package 'qqvases'

Title: Animated Normal Quantile-Quantile Plots
Description: Presents an explanatory animation of normal quantile-quantile plots based on a water-filling analogy. The animation presents a normal QQ plot as the parametric plot of the water levels in vases defined by two distributions. The distributions decorate the axes in the normal QQ plot and are optionally shown as vases adjacent to the plot. The package draws QQ plots for several distributions, either as samples or continuous functions.
Authors: Robert Stine
Maintainer: Robert Stine <[email protected]>
License: GPL-2
Version: 1.0.0
Built: 2025-02-15 04:39:51 UTC
Source: https://github.com/cran/qqvases

Help Index


Make a named list of distribution functions

Description

Constructs the default nested list of distribution functions used to animated normal QQ plots. By default, the list contains Normal Student t_3 Student t_6 Gamma(3) Beta(0.6,0.6) Exotic Each member of the list has 3 named elements [ d = density function (eg, dnorm) q = quantile function (eg, qnorm) r = random generator (eg, rnorm) ] Each of these functions must take a single argument; others must be bound externally. For examples, see the function make.normal.dist or make.t.dist.

Usage

make_df_list()

Value

Named list of (density, quantile, generator) triples for distributions

Examples

make_df_list()

Interactive QQ Plot

Description

This function uses Shiny to open the default web browser. Graphical controls manipulate the construction of an interactive normal QQ plot.

Usage

qq_plot(data, step = 0.05, breaks = "FD")

Arguments

data

Numerical data vector.

step

Stepsize used for Shiny slider (use larger values if animating with play button)

breaks

Passed to histogram for empirical distribution (default = "FD")

Value

None

Examples

## Not run: 
qq_plot(rnorm(50))

qq_plot(rnorm(50), step=0.05, breaks="Sturges")

if(require("MASS", quietly=TRUE)){ qq_plot(geyser$waiting) }

## End(Not run)

Interactive QQ Vase Plot

Description

This function displays animated normal quantile-quantile plots. The software uses Shiny to open a window in the default installed web browser. Graphical controls in that window manipulate the construction of normal quantile plots. The display shows QQ plots for comparing either population distributions or samples of a chosen size. When samples are shown, the plot includes approximate 95

Usage

qq_vase_plot(draw.samples = TRUE, dists = make_df_list(), step = 0.05,
  breaks = "FD")

Arguments

draw.samples

Set to true to allow optional samples from distributions

dists

Named list of (d=density, q=quantile, r=sample) distributions (see make_df_list())

step

Stepsize used for animated slider (use larger values if animating with play button)

breaks

Passed to R histogram program to control number of bins in empirical distribution

Value

None

Examples

## Not run: 
# default
qq_vase_plot()

# suppress sampling option
qq_vase_plot(FALSE)

# add uniform distribution to dialog
dists <- make_df_list()
dists[["uniform"]] <- list(d=dunif, q=qunif, r=runif)
qq_vase_plot(TRUE, dists)

# smaller increments, change the method that determines breaks in histogram
qq_vase_plot(TRUE, step=0.01, breaks=function(x) 2*sqrt(length(x)))

## End(Not run)

qqvases: A package for illustrating the construction of QQ plots.

Description

This package displays an animation of a normal QQ plot. The animation links points in the plot to 'water levels' in vases whose shape is defined by probability distributions. Probability distributions placed along the plot axes gradually fill (become shaded) as a slider locates larger quantiles of the probability distributions. The reference distribution along the x-axis is the normal distribution. See the function qq_vase_plot for further information.


Side-by-side Slider

Description

Opens the default web browser with a display of two continuous distributions shown side-by-side and reflected to suggest a closed container. Interactive options control the display of water levels and the choice of the shapes of the underlying distributions.

Usage

side_by_side_slider(name, dists = make_df_list())

Arguments

name

Name of distribution to contrast with normal

dists

Named list of (d=density, q=quantile, r=sample) distributions (see make_df_list())

Value

None

Examples

## Not run: 
side_by_side_slider("Gamma")

dists <- make_df_list()
dists[["uniform"]] <- list(d=dunif, q=qunif, r=runif);
side_by_side_slider("uniform", dists)

## End(Not run)