Learn R Programming

scrutiny (version 0.4.0)

grim-stats: Possible GRIM inconsistencies

Description

Even without GRIM-testing, means / proportions and sample sizes of granular distributions entail some key data:

  • grim_total() returns the absolute number of GRIM-inconsistencies that are possible given the mean or percentage's number of decimal places (D) and the corresponding sample size.

  • grim_ratio() returns a proportion that is normalized by 10^D, and therefore comparable across mean or percentage values reported to varying D.

  • grim_ratio_upper() returns the upper bound of grim_ratio() for a given D.

For discussion, see vignette("grim"), section GRIM statistics.

Usage

grim_total(x, n, items = 1, percent = FALSE)

grim_ratio(x, n, items = 1, percent = FALSE)

grim_ratio_upper(x, percent = FALSE)

Value

Integer or double. The number or proportion of possible GRIM inconsistencies.

Arguments

x

String or numeric (length 1). Mean or percentage value computed from data with integer units (e.g., mean scores on a Likert scale or percentage of study participants in some condition). Note: Numeric inputs don't include trailing zeros, but these are important for GRIM functions. See documentation for grim().

n

Integer. Sample size corresponding to x.

items

Integer. Number of items composing the mean or percentage value in question. Default is 1.

percent

Logical. Set percent to TRUE if x is expressed as a proportion of 100 rather than 1. The functions will then account for this fact through increasing the decimal count by 2. Default is FALSE.

References

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

See Also

grim() for the GRIM test itself; as well as grim_map() for applying it to many cases at once.

Examples

Run this code
# Many value sets are inconsistent here:
grim_total(x = "83.29", n = 21)
grim_ratio(x = "83.29", n = 21)

# No sets are inconsistent in this case...
grim_total(x = "5.14", n = 83)
grim_ratio(x = "5.14", n = 83)

# ... but most would be if `x` was a percentage:
grim_total(x = "5.14", n = 83, percent = TRUE)
grim_ratio(x = "5.14", n = 83, percent = TRUE)

Run the code above in your browser using DataLab