grim_map {scrutiny} | R Documentation |
Call grim_map()
to GRIM-test any number of combinations of
mean/proportion, sample size, and number of items. Mapping function for
GRIM-testing.
Set percent
to TRUE
if the x
values are percentages. This will
convert x
values to decimals and adjust the decimal count accordingly.
Display intermediary numbers from GRIM-testing in columns by setting
show_rec
to TRUE
.
For summary statistics, call [audit()
] on the results.
grim_map(
data,
items = 1,
merge_items = TRUE,
percent = FALSE,
x = NULL,
n = NULL,
show_rec = FALSE,
show_prob = FALSE,
rounding = "up_or_down",
threshold = 5,
symmetric = FALSE,
tolerance = .Machine$double.eps^0.5,
testables_only = FALSE,
extra = Inf
)
data |
Data frame with columns |
items |
Integer. If there is no |
merge_items |
Logical. If |
percent |
Logical. Set |
x , n |
Optionally, specify these arguments as column names in |
show_rec |
Logical. If set to |
show_prob |
Logical. If set to |
rounding , threshold , symmetric , tolerance |
Further parameters of
GRIM-testing; see documentation for |
testables_only |
Logical. If |
extra |
String or integer. The other column(s) from |
A tibble with these columns –
x
, n
: the inputs.
consistency
: GRIM consistency of x
, n
, and items
.
<extra>
: any columns from data
other than x
, n
, and items
.
ratio
: the GRIM ratio; see grim_ratio()
.
The tibble has the scr_grim_map
class, which is recognized by the
audit()
generic.
If show_rec
is set to TRUE
, the output
includes the following additional columns:
rec_sum
: the sum total from which the mean or proportion was ostensibly
derived.
rec_x_upper
: the upper reconstructed x
value.
rec_x_lower
: the lower reconstructed x
value.
rec_x_upper_rounded
: the rounded rec_x_upper
value.
rec_x_lower_rounded
: the rounded rec_x_lower
value.
With the default for rounding
, "up_or_down"
, each of the last two columns
is replaced by two columns that specify the rounding procedures (i.e.,
"_up"
and "_down"
).
audit()
There is an S3 method for audit()
,
so you can call audit()
following grim_map()
to get a summary of
grim_map()
's results. It is a tibble with one row and these columns –
incons_cases
: number of GRIM-inconsistent value sets.
all_cases
: total number of value sets.
incons_rate
: proportion of GRIM-inconsistent value sets.
mean_grim_ratio
: average of GRIM ratios.
incons_to_ratio
: ratio of incons_rate
to mean_grim_ratio
.
testable_cases
: number of GRIM-testable value sets (i.e., those with a
positive ratio).
testable_rate
: proportion of GRIM-testable value sets.
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
# Use `grim_map()` on data like these:
pigs1
# The `consistency` column shows
# whether the values to its left
# are GRIM-consistent:
pigs1 %>%
grim_map()
# Display intermediary numbers from
# GRIM-testing with `show_rec = TRUE`:
pigs1 %>%
grim_map(show_rec = TRUE)
# Get summaries with `audit()`:
pigs1 %>%
grim_map() %>%
audit()