repeat_test: Performs repeat test across 'break_out' category.

View source: R/repeat_test.R

repeat_testR Documentation

Performs repeat test across break_out category.

Description

Performs repeat test across break_out category.

Usage

repeat_test(
  digitdata,
  break_out,
  data_column = NA,
  duplicate_matching_cols = "all",
  break_out_grouping = NA,
  rounding_patterns_to_omit = NA,
  plot = TRUE
)

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.

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.

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.

Value

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

  • A table of percent repeated numbers for repeat test on each category ordered by decreasing repeats percentage

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

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

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

Examples

repeat_test(digitdata)
repeat_test(digitdata, duplicate_matching_cols=c('col_name1, col_name2'))
repeat_test(digitdata, duplicate_matching_cols=c('col_name1, col_name2'), break_out='col_name')

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