This function tests whether a given standard deviation is within the range that is
theoretically possible for a given sample size and mean, assuming responses are bounded
by a minimum and maximum scale value. It provides a simple TRUE/FALSE
check. Note that SDs within this range may still be impossible due to their granularity,
so for samples where the sample size (x number of items) is below 10 to the power of the
precision of the reported SD, this should only be a precursor to GRIMMER_test()
boundary_test(
sd,
n_obs,
mean,
min_val,
max_val,
m_prec = NULL,
sd_prec = NULL,
n_items = 1,
return_range = FALSE,
quiet = FALSE
)The standard deviation of the distribution
The number of observations (sample size), an integer of at least two for reconstruction.
The mean of the distribution
The minimum value
The maximum value
The precision of the reported mean, as a nonnegative integer number of decimal places (at most 308), consistent with the supplied value. Inferred from the numeric value if omitted; specify it explicitly when the reported mean ends in zero.
The precision of the reported standard deviation, with the same
requirements as m_prec. Specify it explicitly to preserve trailing zeroes.
Positive integer number of items in scale, if distribution represents scale averages. Defaults to 1, which represents any single-item measure.
(Optional) If TRUE, the function returns a numeric vector with the SD possible range.
Suppress warnings.
Logical TRUE if the standard deviation is within the possible
range, and FALSE otherwise, unless return_range, in which case a
numeric vector with the lower and upper bounds of the possible SD range is returned.
If the range is undefined, return_range = TRUE returns two numeric NA values.
Scale endpoints must be integers; multi-item averages have spacing 1 / n_items.
# For a 7-point scale with N = 20 and Mean = 4, an SD of 1.5 is within the possible range
boundary_test(sd = 1.5, n_obs = 20, mean = 4, min_val = 1, max_val = 7)
#> [1] TRUE
# but an SD of 3.5 is not possible
boundary_test(sd = 3.5, n_obs = 20, mean = 4, min_val = 1, max_val = 7)
#> [1] FALSE