View source: R/unpack_round_numbers_test.R
unpack_round_numbers_test | R Documentation |
all_digit_test
.Performs unpack rounded number test by performing all-digit place two-way chi square test vs Benford’s Law.
A wrapper function for all_digit_test
.
unpack_round_numbers_test(
digitdata,
rounding_split_column,
analysis_columns = "all",
digit_places = "all",
break_out = NA,
break_out_grouping = NA,
category = NA,
category_grouping = NA,
distribution = "Benford",
contingency_table = NA,
plot = TRUE,
omit_05 = NA,
skip_first_digit = FALSE,
skip_last_digit = FALSE,
suppress_low_N = FALSE,
suppress_first_division_plots = FALSE,
suppress_second_division_plots = TRUE
)
digitdata |
A object of class |
rounding_split_column |
The data column (numeric!) to split rounded and unrounded digits upon to perform unpacking rounding test. |
analysis_columns |
The names of numeric columns of data to be analyzed. Default can be 'all', where using all data columns in |
digit_places |
The indexes of left-aligned digit places to analyze. There are three options:
|
break_out |
|
break_out_grouping |
A list of arrays, or defaulted to NA. Only effective if
|
category |
The column for splitting the data into sectors for separate analysis. The second division (usually variables) shown in plots. |
category_grouping |
A list of arrays, or defaulted to NA. Only effective if
|
distribution |
'Benford' or 'Uniform'. Case insensitive. Specifies the distribution the chi square test is testing against. Default to 'Benford'. |
contingency_table |
The user-input probability table of arbitrary distribution. Overwrites
|
plot |
TRUE or FALSE or 'Save': If TRUE, display the plots and return them. If 'Save', return the plots but suppress display. If FALSE, no plot is produced. Default to TRUE. |
omit_05 |
Whether to omit 0 or both 0 and 5. If omit both 0 and 5, pass in c(0,5) or c(5,0); if omit only 0 pass in 0 or c(0); if omit neither, pass in NA. Default to NA. |
skip_first_digit |
TRUE or FALSE: If TRUE, skip first digit place before analysis. Default to FALSE. |
skip_last_digit |
TRUE or FALSE: If TRUE, skip last digit place before analysis, since we don't want tests to overlap. Default to FALSE.
|
suppress_low_N |
TRUE or FALSE: If TRUE, suppress columns in expected table if at least one cell in that column has expected value < 5. Default to FALSE. |
suppress_first_division_plots |
TRUE or FALSE: If TRUE, suppress the display of all plots on first and second division.
If TRUE, |
suppress_second_division_plots |
TRUE or FALSE: If TRUE, suppress the display of all plots on second division. |
A list of p-values for round and unround data break by break_out
and category
if specified
A list of sample sizes for round and unround data break by break_out
and category
if specified
A list of merged plots, rounded data plots, and un rounded data plots break by break_out
and category
if specified
iff plot = TRUE or 'Save'
unpack_round_numbers_test(digitdata, rounding_split_column='col_name', analysis_columns=c('X', 'Y'))
unpack_round_numbers_test(digitdata, rounding_split_column='col_name', digit_places=c(1,2,3), break_out='A', category='Y')
unpack_round_numbers_test(digitdata, rounding_split_column='col_name', break_out='A', omit_05=c(0,5), suppress_low_N=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.