rounding_test: Performs rounding test vs uniform distribution across...

View source: R/rounding_test.R

rounding_testR Documentation

Performs rounding test vs uniform distribution across categories in a specified data column

Description

Performs rounding test vs uniform distribution across categories in a specified data column

Usage

rounding_test(
  digitdata,
  rounding_patterns,
  break_out,
  data_columns = "all",
  break_out_grouping = NA,
  plot = TRUE
)

Arguments

digitdata

A object of class DigitAnalysis.

rounding_patterns

The patterns to be counted as rounding digits.

  • An array of characters such as c('0','00','000','5','50','500', '75', '25').

  • n_zeros_pattern might be helpful for generating strings of 0s.

break_out
  • The data column (non-numeric!) to split up the dataset based on different categories in the column if specified as an character.

  • The first division (usually x-axis) shown in plots.

data_columns

The names of numeric columns of data to be analyzed. Default can be 'all', where using all data columns in numbers df in digitdata; an array of column names, as characters; a single column name, as character.

break_out_grouping

A list of arrays, or defaulted to NA. Only effective if break_out is not NA.

  • Each the names of the elements in the list is the break_out name

  • Each array contains the values belonging to that break_out

  • If it is remain as NA as default, while break_out is not NA, then break_out_grouping will default to every individual item in break_out will be in a separate group.

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.

Value

  • A table of p values of t test for rounding test on each category

  • A table of percent rounded digits for rounding test on each category ordered by decreasing rounded percentage

  • A table of sample sizes for rounding test on each category

  • Plots for each category if plot = TRUE or 'Save'

Examples

rounding_test(digitdata)
rounding_test(digitdata, omit_05=0)
rounding_test(digitdata, omit_05=NA, break_out='col_name')
rounding_test(digitdata, data_columns=c('col_name1', 'col_name2'))

jlederluis/digitanalysis documentation built on Nov. 5, 2023, 11:46 a.m.