debit_map_total_n() extends DEBIT to cases where only group
means and standard deviations (SDs) were reported, not group sizes.
The function is analogous to grim_map_total_n() and
grimmer_map_total_n(), relying on the same infrastructure.
Usage
debit_map_total_n(
data,
x1 = NULL,
x2 = NULL,
sd1 = NULL,
sd2 = NULL,
dispersion = 0:5,
n_min = 1L,
n_max = NULL,
constant = NULL,
constant_index = NULL,
...
)Arguments
- data
Data frame with string columns
x1,x2,sd1, andsd2, as well as numeric columnn. The first two are reported group means.sd1andsd2are reported group SDs.nis the reported total sample size. It is not very important whether a value is inx1or inx2because, after the first round of tests, the function switches roles betweenx1andx2, and reports the outcomes both ways. The same applies tosd1andsd2. However, do make sure thex*andsd*values are paired accurately, as reported.- x1, x2, sd1, sd2
Optionally, specify these arguments as column names in
data.- dispersion
Numeric. Steps up and down from half the
nvalues. Default is0:5, i.e., halfnitself followed by five steps up and down.- n_min
Numeric. Minimal group size. Default is 1.
- n_max
Numeric. Maximal group size. Default is
NULL, i.e., no maximum.- constant
Optionally, add a length-2 vector or a list of length-2 vectors (such as a data frame with exactly two rows) to accompany the pairs of dispersed values. Default is
NULL, i.e., no constant values.- constant_index
Integer (length 1). Index of
constantor the firstconstantcolumn in the output tibble. IfNULL(the default),constantwill go to the right ofn_change.- ...
Arguments passed down to
debit_map().
Value
A tibble with these columns:
xandsd, the group-wise reported input statistics, are repeated in row pairs.nis dispersed from half the inputn, withn_changetracking the differences.both_consistentflags scenarios where both reportedxandsdvalues are consistent with the hypotheticalnvalues.casecorresponds to the row numbers of the input data frame.diris"forth"in the first half of rows and"back"in the second half."forth"means thatx2andsd2from the input are paired with the larger dispersedn, whereas"back"means thatx1andsd1are paired with the larger dispersedn.Other columns from
debit_map()are preserved.
Summaries with audit_total_n()
You can call
audit_total_n() following up on debit_map_total_n()
to get a tibble with summary statistics. It will have these columns:
x1,x2,sd1,sd2, andnare the original inputs.hits_totalis the number of scenarios in which all ofx1,x2,sd1, andsd2are DEBIT-consistent. It is the sum ofhits_forthandhits_backbelow.hits_forthis the number of both-consistent cases that result from pairingx2andsd2with the larger dispersednvalue.hits_backis the same, exceptx1andsd1are paired with the larger dispersednvalue.scenarios_totalis the total number of test scenarios, whether or not bothx1andsd1as well asx2andsd2are DEBIT-consistent.hit_rateis the ratio ofhits_totaltoscenarios_total.
Call audit() following audit_total_n() to summarize results
even further.
References
Bauer, P. J., & Francis, G. (2021). Expression of Concern: Is It Light or Dark? Recalling Moral Behavior Changes Perception of Brightness. Psychological Science, 32(12), 2042–2043. https://journals.sagepub.com/doi/10.1177/09567976211058727
Heathers, J. A. J., & Brown, N. J. L. (2019). DEBIT: A Simple Consistency Test For Binary Data. https://osf.io/5vb3u/.
See also
function_map_total_n(), which created the present function using
debit_map().
Examples
# Run `debit_map_total_n()` on data like these:
df <- tibble::tribble(
~x1, ~x2, ~sd1, ~sd2, ~n,
"0.30", "0.28", "0.17", "0.10", 70,
"0.41", "0.39", "0.09", "0.15", 65
)
df
#> # A tibble: 2 × 5
#> x1 x2 sd1 sd2 n
#> <chr> <chr> <chr> <chr> <dbl>
#> 1 0.30 0.28 0.17 0.10 70
#> 2 0.41 0.39 0.09 0.15 65
debit_map_total_n(df)
#> # A tibble: 48 × 15
#> x sd n n_change consistency both_consistent rounding sd_lower
#> <chr> <chr> <int> <int> <lgl> <lgl> <chr> <dbl>
#> 1 0.30 0.17 35 0 FALSE FALSE up_or_down 0.165
#> 2 0.28 0.10 35 0 FALSE FALSE up_or_down 0.095
#> 3 0.30 0.17 34 -1 FALSE FALSE up_or_down 0.165
#> 4 0.28 0.10 36 1 FALSE FALSE up_or_down 0.095
#> 5 0.30 0.17 33 -2 FALSE FALSE up_or_down 0.165
#> 6 0.28 0.10 37 2 FALSE FALSE up_or_down 0.095
#> 7 0.30 0.17 32 -3 FALSE FALSE up_or_down 0.165
#> 8 0.28 0.10 38 3 FALSE FALSE up_or_down 0.095
#> 9 0.30 0.17 31 -4 FALSE FALSE up_or_down 0.165
#> 10 0.28 0.10 39 4 FALSE FALSE up_or_down 0.095
#> # ℹ 38 more rows
#> # ℹ 7 more variables: sd_incl_lower <lgl>, sd_upper <dbl>, sd_incl_upper <lgl>,
#> # x_lower <dbl>, x_upper <dbl>, case <int>, dir <fct>