Return key statistical quantities generated from value, lower and upper confidence bounds
statCI.Rd
A function is generated that can be called with a number of keywords to return the requested quantity of interest, accordingly. The function is typically used in IQRtable.
statCI(value, lower, upper, CL = 0.95, digits = NA)
Arguments
- value
numeric values.
- lower
the lower confidence bound of the value.
- upper
the upper confidence bound of the value.
- CL
confidence level to which the provided lower and upper bounds correspond.
- digits
number of significant digits (if NA (default), format_GUM is used to determine number of significant digits, otherwise, signif function is used instead of format_GUM)
Value
Function outfn(char)
that can be called with the key words
value
(value rounded to significant digits according to standard error)se
(standard error rounded to two significant digits)rse
(relative standard error rounded to significant digits according to standard error)rse%
(relative standard error as percentage)lower.x
wherex
is between 1 and 99 (lower confidence bound rounded to significant digits according to standard error)upper.x
wherex
is between 1 and 99 (upper confidence bound rounded to significant digits according to standard error)
Details
The function uses format_GUM to round to significant digits and format the output.
Interpolation between different requested output confidence levels is based on approximation by
a left- and right-handed standard error. From the (possibly) asymmetric confidence intervals, left/right-handed standard
errors are determined such that the lower/upper confidence bound corresponding to the procided CL
matches the provided
lower/upper bounds. Extrapolation to other confidence levels is performed separately for upper and lower bounds using the
right and left standard error, respectively.
The reported standard error is the mean of left and right standard error. In case, either of the standard errors is not defined, the reported standard error is NA.
The standard error of rse
is assumed
to be rse^2
which is derived by Gaussian error propagation and the assumption that se
is known without uncertainty.
format_GUM returns values rounded to significant digits according to the provided standard error. For asymmetric confidence intervals we use the smaller value of the approximated left and right standard errors for rounding of values.