| debit_values | R Documentation |
debit_values() returns every pair of a mean and an SD that n binary
values (0 and 1) can have and that would be reported as x and sd. It
is the counterpart of grim_values() and grimmer_values() for
debit(), which is TRUE exactly if there is at least one such pair.
debit_closest() returns the single achievable pair whose SD is closest
to sd, like grimmer_closest(). If x and sd are consistent, it
is one of the pairs that debit_values() returns. Otherwise, it is
closest among the pairs whose mean would be reported as x, or, if there
are none, it is the pair whose mean grim_closest() returns.
debit_values(
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
)
debit_closest(
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. |
sd_meaning |
String. As in |
formula |
String. As in |
rounding |
String. The rounding method assumed to have produced |
threshold, symmetric |
The same as in |
More than a million numbers of ones whose mean would be reported as
x is an error, since they are listed before the SD narrows them down.
That takes an n of more than about 10^(digits_x + 6).
In debit_closest(), pairs whose SDs are equally close go by the mean
closer to x, then by the smaller number of ones.
A tibble with one row per achievable pair. case is the index of
the value set, as in grim_values(). x and sd are the achievable
values, n the reported sample size, and sum the number of ones, k
in the mean k / n. An inconsistent value set has no rows, and one that
cannot be decided has one row of NA but for n, as in debit().
debit_closest() returns the same columns with exactly one row per value
set: of NA but for n if a value is missing or the value set cannot be
decided.
debit(), debit_map(), debit_plot_line(), and
sd_binary_groups().
# A mean of 0.35 and an SD of 0.49 are consistent with 20 binary values,
# 7 of them ones:
debit_values(
x = 0.35,
sd = 0.49,
n = 20,
digits_x = 2,
digits_sd = 2,
data_type = "integer"
)
# None if the value set is inconsistent:
debit_values(
x = 0.35,
sd = 0.41,
n = 20,
digits_x = 2,
digits_sd = 2,
data_type = "integer"
)
# With few decimal places and a large sample, there can be several:
debit_values(
x = 0.5,
sd = 0.5,
n = 300,
digits_x = 1,
digits_sd = 1,
data_type = "integer"
)
# The closest pair to an inconsistent one:
debit_closest(
x = 0.35,
sd = 0.41,
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.