Description Usage Arguments Details Value Warning Author(s) References See Also Examples
Density, distribution function, quantile function and random generation for Mandel's k statistic, a measure of relative precision compared to a common variance.
1 2 3 4 |
x, q |
vector of quantiles. |
p |
vector of probabilities. |
g |
number of groups for which k is calculated. |
n |
number of observations in each group of data for which k is calculated. |
B |
Number of observations. If 'length(B) > 1', the length is taken to be the number required. |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x]; otherwise, P[X > x]. |
log, log.p |
logical; if TRUE, probabilities p are given as log(p). |
Mandel's k for one of a set of g standard deviations s is calculated as
k=\frac{s_{ij}^2}{∑_{i=1}^p{s_{ij}^2/p}}
Since the numerator is chi-squared(n-1), or Gamma((n-1)/2, 2), and the denominator
can be written as the sum of the same quantity and a pooled variance with distribution
Gamma((g-1)*(n-1)/2, 2), k is distributed as Beta((n-1)/2, (g-1)(n-1)/2).
Quantiles, probabilities, density and random numbers can therefore be generated
from the Beta distribution. For example, qmandelk is calculated as
sqrt( g * qbeta( (n-1)/2, (g-1)*(n-1)/2))
.
dmandelh returns the density at x
, pmandelh the cumulative probability,
qmandelh the quantiles for probability p
and rmandelh returns B
random values drawn from the distribution.
Vector values of x, p, q and g are permitted, in which case the functions return vectors.
Note that rmandelk
uses B
and not n
(as do most R random
number functions) for number of random draws; this is because n
is conventionally
used for the number of replicates per group. Be careful when using named parameters!
S. L. R. Ellison, s.ellison@lgc.co.uk
None.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.