eda_fval | R Documentation |
Calculates Fractional Values (f-Values).
eda_fval(x, q.type = 5)
x |
Vector whose f-values are to be computed. |
q.type |
An integer specifying the algorithm to use for computing F-values. |
This function computes the fractional value (f-value) for each
element in a numeric vector x
. The f-value provides a measure of the
position of a data point relative to the rest of the data, scaled to the
range [0,1]. This fraction is sometimes reported as the
probability or cumulative frequency.
Different algorithms are used to compute the f-value. eda_fval
offers as optional algorithm type 4
through 9
documented
in stats::quantile
. The algorithms used are:
4
: f = i / n,
5
: f = (i - 0.5) / n,
6
: f = i / (n + 1),
7
: f = (i - 1) / (n - 1),
8
: f = (i - 1/3) / (n + 1/3),
9
: f = (i - 3/8) / (n + 1/4).
Where f is the fraction of values that lies below index i, and n is the total number values.
A numeric vector of the same length as x
, containing the f-values
for each input value. The order of the returned f-values matches the input
vector.
John M. Chambers, William S. Cleveland, Beat Kleiner, Paul A. Tukey. Graphical Methods for Data Analysis (1983)
stats::quantile()
for quantile calculations
eda_qq
for QQ plots
set.seed(321)
z <- round(runif(10, 1, 20))
z
# William Cleveland's f-values algorithm
eda_fval(z)
# Algorithm used by the stats::quantile() function
eda_fval(z, q.type = 7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.