debit_map: Apply DEBIT to many cases

View source: R/debit-map.R

debit_mapR Documentation

Apply DEBIT to many cases

Description

Call debit_map() to use DEBIT on multiple combinations of mean, sample standard deviation, and sample size of binary distributions. Mapping function for debit().

For summary statistics, call audit() on the results.

Usage

debit_map(
  data,
  x = NULL,
  sd = NULL,
  n = NULL,
  rounding = "up_or_down",
  threshold = 5,
  symmetric = FALSE,
  show_rec = TRUE,
  extra = Inf
)

Arguments

data

Data frame.

x, sd, n

Optionally, specify these arguments as column names in data.

rounding, threshold, symmetric

Arguments passed on to debit(), with the same defaults.

show_rec

If set to FALSE, the resulting tibble only includes the columns x, sd, n, and consistency. Default is TRUE.

extra

Not currently used.

Value

A tibble with (at least) these columns –

  • x, sd, n: the inputs.

  • consistency: DEBIT consistency of x, sd, and n.

    By default, the tibble also includes the rounding method, boundary values, and information about the boundary values being inclusive or not. The tibble has the scr_debit_map class, which is recognized by the audit() generic.

Summaries with audit()

There is an S3 method for the audit() generic, so you can call audit() following debit_map(). It returns a tibble with these columns —

  1. incons_cases: the number of DEBIT-inconsistent cases.

  2. all_cases: the total number of cases.

  3. incons_rate: the rate of inconsistent cases.

  4. mean_x: the mean x (mean) value.

  5. mean_sd: the mean sd value.

  6. distinct_n: the number of distinct n values.

References

Heathers, James A. J., and Brown, Nicholas J. L. 2019. DEBIT: A Simple Consistency Test For Binary Data. https://osf.io/5vb3u/.

Examples

# Call `debit_map()` on binary summary
# data such as these:
pigs3

# The `consistency` column shows
# whether the values to its left
# are DEBIT-consistent:
pigs3 %>%
  debit_map()

# Get test summaries with `audit()`:
pigs3 %>%
  debit_map() %>%
  audit()

scrutiny documentation built on Sept. 22, 2024, 9:06 a.m.