Title: | Mountain Plots, Folded Empirical Cumulative Distribution Plots |
---|---|
Description: | Lattice functions for drawing folded empirical cumulative distribution plots, or mountain plots. A mountain plot is similar to an empirical CDF plot, except that the curve increases from 0 to 0.5, then decreases from 0.5 to 1 using an inverted scale at the right side. See Monti (1995) <doi:10.1080/00031305.1995.10476179>. |
Authors: | Kevin Wright [aut, cre, cph] |
Maintainer: | Kevin Wright <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.4 |
Built: | 2024-11-18 06:10:27 UTC |
Source: | https://github.com/kwstat/mountainplot |
A mountain plot is similar to an empirical CDF, but _decreases_ from .5 down to 1, using a separate scale on the right axis.
mountainplot(x, data, ...) mountainplotyscale.components(...) ## S3 method for class 'formula' mountainplot( x, data = NULL, prepanel = "prepanel.mountainplot", panel = "panel.mountainplot", ylab = gettext("Folded Empirical CDF"), yscale.components = mountainplotyscale.components, scales = list(y = list(alternating = 3)), ... ) ## S3 method for class 'numeric' mountainplot(x, data = NULL, xlab = deparse(substitute(x)), ...)
mountainplot(x, data, ...) mountainplotyscale.components(...) ## S3 method for class 'formula' mountainplot( x, data = NULL, prepanel = "prepanel.mountainplot", panel = "panel.mountainplot", ylab = gettext("Folded Empirical CDF"), yscale.components = mountainplotyscale.components, scales = list(y = list(alternating = 3)), ... ) ## S3 method for class 'numeric' mountainplot(x, data = NULL, xlab = deparse(substitute(x)), ...)
x |
Variable in the data.frame 'data'. |
data |
A data frame |
... |
Other arguments |
prepanel |
The prepanel function. Default "prepanel.mountainplot". |
panel |
The panel function. Default "panel.mountainplot". |
ylab |
Vertical axis label. |
yscale.components |
Function for drawing left and right side axes. |
scales |
The "scales" argument used by lattice functions. |
xlab |
Horizontal axis label. |
Note that 'mountainplotyscale.components' is not really intended to be called by the user, but is used by lattice to configure the right-axis ticks and labels.
A lattice object
K. L. Monti. (1995). Folded empirical distribution function curves-mountain plots. The American Statistician, 49, 342–345. http://www.jstor.org/stable/2684570
Xue, J. H., & Titterington, D. M. (2011). The p-folded cumulative distribution function and the mean absolute deviation from the p-quantile. Statistics & Probability Letters, 81(8), 1179-1182.
data(singer, package = "lattice") singer <- within(singer, { section <- voice.part section <- gsub(" 1", "", section) section <- gsub(" 2", "", section) section <- factor(section) }) mountainplot(~height, data = singer, type='b') mountainplot(~height|voice.part, data = singer, type='p') mountainplot(~height|section, data = singer, groups=voice.part, type='l', auto.key=list(columns=4), as.table=TRUE)
data(singer, package = "lattice") singer <- within(singer, { section <- voice.part section <- gsub(" 1", "", section) section <- gsub(" 2", "", section) section <- factor(section) }) mountainplot(~height, data = singer, type='b') mountainplot(~height|voice.part, data = singer, type='p') mountainplot(~height|section, data = singer, groups=voice.part, type='l', auto.key=list(columns=4), as.table=TRUE)
The panel function for mountainplot
panel.mountainplot(x, type = "s", groups = NULL, ref = TRUE, ...)
panel.mountainplot(x, type = "s", groups = NULL, ref = TRUE, ...)
x |
The data to be plotted. |
type |
The type of ecdf line to use. Default is 's' square. |
groups |
Variable to use for grouping |
ref |
If TRUE, draw horizontal reference lines at 0,1 |
... |
Other arguments |
The prepanel function for mountainplot
prepanel.mountainplot(x, ...)
prepanel.mountainplot(x, ...)
x |
The data to be plotted. |
... |
Other arguments |