sector_test: Performs sector test to analyze uneven distribution of...

View source: R/sector_test.R

sector_testR Documentation

Performs sector test to analyze uneven distribution of percent repeats across sectors (supposed to be uniform). A wrapper function for repeat_test.

Description

Performs sector test to analyze uneven distribution of percent repeats across sectors (supposed to be uniform). A wrapper function for repeat_test.

Usage

sector_test(
  digitdata,
  break_out,
  category,
  category_instance_analyzing,
  data_column = NA,
  duplicate_matching_cols = "all",
  break_out_grouping = NA,
  category_grouping = NA,
  rounding_patterns_to_omit = NA,
  plot = TRUE,
  remove_all_category_visualize = FALSE
)

Arguments

digitdata

A object of class DigitAnalysis.

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.

category

The column for splitting the data into sectors for separate analysis. The second division (usually variables) shown in plots.

category_instance_analyzing

The instance of the category to perform t test on.

data_column

The data column to omit rounding numbers upon. Must be a single column.

duplicate_matching_cols

An array of names of data columns two rows need to match exactly in order to be defined as a repeat. Must include data_column. Default to 'all', meaning matching all columns in 'number' slot of digitdata.

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.

category_grouping

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

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

  • Each array contains the values belonging to that category

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

rounding_patterns_to_omit

The patterns to be counted as rounding digits to skip. Defaulted to NA.

  • 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.

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.

remove_all_category_visualize

TRUE or FALSE: If TRUE, remove visualization of 'All Category' dataset for plots

Value

  • A table of p-values for repeat test by sector on each category

  • Plots for each break out element with variables as categories specified by category_grouping if plot = TRUE or 'Save'

  • If NaN is in returned table, it means that there are no occurances of the data of the sector in that category –> 0/0 in percentage

Examples

sector_test(digitdata, break_out='column', category='sector', category_instance_analyzing='X')
sector_test(digitdata, break_out='A', category='B', category_instance_analyzing='X', data_column='Y', rounding_patterns_to_omit='00')

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