| grim-stats | R Documentation |
These functions quantify how informative a GRIM test is for a given sample size and number of decimal places:
grim_exp_incon() returns the probability that a mean or percentage
with digits_x random decimal digits is GRIM-inconsistent with n. It
is the exp_incon column of grim_map().
grim_total() returns the number of such inconsistent values between
two whole numbers, out of 10^digits_x (10^(digits_x + 2) with
x_meaning = "percentage").
See vignette("grim-in-depth"), section GRIM statistics.
grim_exp_incon(
x,
n,
digits_x,
items_averaged,
data_type,
x_meaning = c("mean", "percentage"),
rounding = "up_or_down",
threshold = 5,
percent = deprecated()
)
grim_total(
x,
n,
digits_x,
items_averaged,
data_type,
x_meaning = c("mean", "percentage"),
rounding = "up_or_down",
threshold = 5,
percent = deprecated()
)
x, n, digits_x, items_averaged, and data_type are
recycled to a common length by the tidyverse rules: an argument has
length 1 or the length of the longest.
Double. For integer data, grim_exp_incon() and grim_total()
return NA if x is missing or infinite, if digits_x is missing, or if
n or items_averaged is missing or not a positive whole number. These
include every case that grim() cannot decide, and some that it can: a
mean may pass whatever n is, but how many fail depends on it. For
continuous data, they return 0, or NA where grim() is NA. Under
data_type = NA, they return NA unless the count is 0. A count above
2^53, which only digits_x of 14 or more with x_meaning = "percentage"
can reach, is the nearest number a double can hold.
Brown, N. J. L., & Heathers, J. A. J. (2017). The GRIM Test: A Simple Technique Detects Numerous Anomalies in the Reporting of Results in Psychology. Social Psychological and Personality Science, 8(4), 363–369. https://journals.sagepub.com/doi/10.1177/1948550616673876
grim() and grim_map().
# Many value sets are inconsistent here:
grim_exp_incon(
x = 83.29,
n = 21,
digits_x = 2,
items_averaged = 1,
data_type = "integer"
)
grim_total(
x = 83.29,
n = 21,
digits_x = 2,
items_averaged = 1,
data_type = "integer"
)
# None are in this case...
grim_exp_incon(
x = 5.14,
n = 120,
digits_x = 2,
items_averaged = 1,
data_type = "integer"
)
grim_total(
x = 5.14,
n = 120,
digits_x = 2,
items_averaged = 1,
data_type = "integer"
)
# ...but most would be if `x` were a percentage:
grim_exp_incon(
x = 5.14,
n = 120,
digits_x = 2,
items_averaged = 1,
data_type = "integer",
x_meaning = "percentage"
)
grim_total(
x = 5.14,
n = 120,
digits_x = 2,
items_averaged = 1,
data_type = "integer",
x_meaning = "percentage"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.