algS {metRology} | R Documentation |
‘Algorithm S’ - robust estimate of pooled standard deviation
Description
‘Algorithm S’ calculates a robust estimate of pooled standard deviation from a set of standard deviations
Usage
algS(s, degfree, na.rm = FALSE, prob.eta = 0.9,
is.range = FALSE, tol = .Machine$double.eps^0.25,
maxiter = 25, verbose = FALSE)
Arguments
s |
A vector of standard deviations or, if |
degfree |
Scalar number of degrees of freedom associated with all
values in |
na.rm |
a logical value indicating whether 'NA' values should be stripped before the computation proceeds. |
prob.eta |
prob.eta is set to specify the lower tail area of the chi-squared distribution used as a cut-off. |
is.range |
if is.range is TRUE, s is interpreted as a vector of positive differences of duplcate observations and degfree is set to 1 |
tol |
Convergence tolerance Iteration continues until the relative
change in estimated pooled sd drops below |
maxiter |
Maximum number of iterations permitted. |
verbose |
Controls information displayed during iteration; see Details. |
Details
Algorithm S is suggested by ISO 5725-5:1998 as a robust estimator of
pooled standard deviation from standard deviations of
groups of size
.
The algorithm calculates a ‘limit factor’, , set to
qchisq(prob.eta, degfree)
. Following an initial estimate of
as
median(s)
, the standard deviations
are replaced with
and an updated value for
calculated as
where is the number of standard deviations and
is calculated as
If the are ranges of two values, ISO 5725 recommends
carrying out the above iteration on the ranges and then dividing by
; in the implementation here, this
is done prior to returning the estimate.
If verbose
is non-zero, the current iteration number
and estimate are printed; if verbose>1
, the current set
of truncated values is also printed.
Value
A scalar estimate of poooled standard deviation.
Author(s)
S L R Ellison s.ellison@lgc.co.uk
References
ISO 5725-5:1998 Accuracy (trueness and precision) of measurement methods and results - Part 5: Alternative methods for the determination of the precision of a standard measurement method
See Also
Examples
#example from ISO 5725-5:1998 (cell ranges for percent creosote)
cdiff <- c(0.28, 0.49, 0.40, 0.00, 0.35, 1.98, 0.80, 0.32, 0.95)
algS(cdiff, is.range=TRUE)
#Compare with the sd of the two values (based on the range)
c.sd <- cdiff/sqrt(2)
algS(c.sd, degfree=1, verbose=TRUE)