grimmer_explain() tests a single mean and SD like
grimmer() does, but also lays out the calculation in plain words. It
starts with the GRIM test of the mean, as in grim_explain(), and goes
on to the sum of squares that each possible sum implies with the SD.
The text is built from the numbers that decide the test itself, so it
always agrees with grimmer().
grimmer_explain(
x,
sd,
n,
digits_x,
digits_sd,
items_averaged,
data_type,
sd_meaning = c("sd_sample", "sd_pop", "sd_sample_or_pop", "se"),
rounding = "up_or_down",
threshold = 5,
symmetric = FALSE
)An object of class scrutiny_explain: a list with the result as
consistency (TRUE, FALSE, or NA), the explanation's paragraphs,
and the test and its inputs. It prints as the explanation.
Numeric. The reported mean.
Numeric. The reported standard deviation.
Integer. The reported sample size.
Integer. The number of decimal places in x, including
trailing zeros. There is no default, since a numeric value does not
keep them (1.40 is 1.4).
Integer. The number of decimal places in sd, including
trailing zeros. There is no default, since a numeric value does not
keep them (1.40 is 1.4).
Integer. As in grim(), for x and sd.
String. As in grim(): "integer" or "continuous".
No default. Continuous data can have any mean and any SD of 0 or more, but
a single value only an SD of 0.
String. What sd really is. "sd_sample" (the
default) is the sample SD, which divides by n - 1; "sd_pop" is the
population SD, which divides by n; "sd_sample_or_pop" accepts either;
"se" is the standard error of the mean, the sample SD divided by
sqrt(n), reported as if it were an SD. See Defaults and SD meaning
in grimmer().
String. The rounding method assumed to have produced x.
Default is "up_or_down", which accepts either direction; see
Defaults in grim(). The others are "up_from_or_down_from",
"ceiling_or_floor", "up", "down", "even",
"up_from", "down_from", "ceiling", "floor", "trunc",
"anti_trunc", "ties_up", "ties_down", "ties_away", "ties_zero",
and "ties_even". See
vignette("rounding-options", package = "roundwork").
Numeric. For rounding = "up_from", "down_from", or
"up_from_or_down_from", the point within a step at which rounding
switches direction, in tenths of a step. Default is 5. Ignored
otherwise.
Logical. If TRUE, negative numbers are rounded like
their absolute values (-2.5 like 2.5) under "up", "down", and the
"*_from" methods. Default is FALSE. Must not be TRUE with a
"ties_*" rounding method, which already fixes the direction; see
roundwork::reround().
grimmer_explain(
x = 5.23,
sd = 2.55,
n = 35,
digits_x = 2,
digits_sd = 2,
items_averaged = 1,
data_type = "integer"
)
grimmer_explain(
x = 5.23,
sd = 2.55,
n = 31,
digits_x = 2,
digits_sd = 2,
items_averaged = 1,
data_type = "integer"
)
Run the code above in your browser using DataLab