Note that rmandelh uses B and not n (as do most R random
number functions) for number of random draws; this is for compatibility with
the relevant functions for Mandel's k, for which n is conventionally
used for the number of replicates per group. Be careful when using named parameters!
Details
Mandel's h is calculated for a particular mean value y[i] in a set of
mean values y as
h[i] = ( y[i] - mean(y) )/sd(y) )
The density, probabilities and quantiles can be derived from the beta distribution:
(1+h*sqrt(g)/(g-1))/2 is distributed as Beta((g-2)/2, (g-2)/2).
#Generate the 95% and 99% quantiles for comparison with tables in #ISO 5725:1996 Part 2: n <- 3:30round(qmandelh(0.975, n), 2) #95% 2-tailedround(qmandelh(0.995, n), 2) #99% 2-tailed