| debit | R Documentation |
debit() checks whether the reported mean and standard
deviation of binary data are consistent with the reported sample size.
With k ones among n values, the mean is k / n and the SD follows
from k and n; the test asks whether any k produces both reported
numbers at their decimal places.
The function is vectorized, but debit_map() is more convenient for
testing many cases.
debit(
x,
sd,
n,
digits_x,
digits_sd,
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
)
x |
Numeric. The reported mean of the binary data, between 0 and 1. |
sd |
Numeric. The reported standard deviation, between 0 and 1. |
n |
Integer. The reported sample size. |
digits_x, digits_sd |
Integer. The number of decimal places in |
data_type |
String. As in |
sd_meaning |
String. What |
formula |
String. |
rounding |
String. The rounding method assumed to have produced |
threshold, symmetric |
The same as in |
x, sd, n, digits_x, digits_sd, and data_type are
vectorized and recycled to a common length by the tidyverse rules. All
other arguments must have length 1.
x and sd are limited to about 15 significant digits, and x with n
as in grim(). Within these limits, debit() decides value sets of
any size exactly. With x missing, n must be below 2^52, about 4.5e15.
Logical. TRUE if x, sd, and n are consistent, FALSE if not,
and NA if the case cannot be decided: if n is not a positive whole
number, or if a missing value could decide the case either way. See
vignette("technical-notes"), section Missing values, on which cases a
missing value leaves open. A sample SD divides by n - 1, so under
sd_meaning = "sd_sample" (the default) and "se", n must also be at
least 2.
Heathers, James A. J., and Brown, Nicholas J. L. 2019. DEBIT: A Simple Consistency Test For Binary Data. https://osf.io/5vb3u/.
debit_explain() to explain a result in plain words,
debit_map() for data frames, and debit_values() and
debit_plot_line() for the means and SDs behind a value set.
debit(
x = 0.36,
sd = 0.11,
n = 20,
digits_x = 2,
digits_sd = 2,
data_type = "integer"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.