| debit_map | R Documentation |
debit_map() applies debit() to every row of a data frame
with means, standard deviations, and sample sizes of binary data.
Call audit() on the output for summary statistics and
debit_plot() to visualize it.
debit_map(
data,
digits_x,
digits_sd,
x = NULL,
sd = NULL,
n = NULL,
...,
data_type,
sd_meaning = c("sd_sample", "sd_pop", "sd_sample_or_pop", "se"),
formula = c("exact", "mean_n"),
rounding = "up_or_down",
threshold = 5,
symmetric = FALSE,
show_rec = FALSE
)
data |
Data frame with columns |
digits_x, digits_sd |
Integer. The number of decimal places in |
x, sd, n |
Optionally, the names of the columns in |
... |
These dots must be empty. Every argument after them must be named in full. |
data_type |
String. As in |
formula, rounding, threshold, symmetric, sd_meaning |
Passed on to
|
show_rec |
Logical. If |
A tibble with these columns:
x, sd, n: the inputs.
data_type: the kind of data, as given.
digits_x, digits_sd: the numbers of decimal places, as given.
consistency: DEBIT consistency of x, sd, and n. NA for a case
that cannot be decided, such as one with a missing value.
Any other columns from data.
If show_rec is TRUE, further columns right after consistency hold the
reconstructed values: the bounds of sd and x (sd_lower, sd_upper,
x_lower, x_upper) with sd_incl_lower and sd_incl_upper saying whether
the SD bounds are inclusive; and sum_lower and sum_upper, the least and
the greatest number of ones among n values whose mean would be reported as
x. Under formula = "exact", a value set is consistent exactly if some k
from sum_lower to sum_upper has an SD within the bounds of sd.
The tibble has the class scrutiny_debit_map, which is recognized by
audit() and debit_plot().
audit()audit() on debit_map() output
returns a tibble with one row and these columns:
all_cases: total number of value sets.
incon_cases: number of DEBIT-inconsistent value sets.
emp_incon: proportion of DEBIT-inconsistent value sets.
mean_x: mean of the x values.
mean_sd: mean of the sd values.
distinct_n: number of distinct n values.
Heathers, James A. J., and Brown, Nicholas J. L. 2019. DEBIT: A Simple Consistency Test For Binary Data. https://osf.io/5vb3u/.
explain_map() and explain_print() to explain each row's
result in plain words.
# 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(digits_x = 2, digits_sd = 2, data_type = "integer")
# Get test summaries with `audit()`:
pigs3 |>
debit_map(digits_x = 2, digits_sd = 2, data_type = "integer") |>
audit()
# Explain the results in plain words:
pigs3 |>
debit_map(digits_x = 2, digits_sd = 2, data_type = "integer") |>
explain_print(1:2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.