get_expected_mean: Obtains expected mean conforming to Benford's Law from input...

View source: R/padding_test.R

get_expected_meanR Documentation

Obtains expected mean conforming to Benford's Law from input data based on the number of digits in each left-aligned digit place

Description

Obtains expected mean conforming to Benford's Law from input data based on the number of digits in each left-aligned digit place

Usage

get_expected_mean(
  digitdata,
  data,
  Benford_mean,
  max_length,
  num_digits,
  omit_05
)

Arguments

digitdata

A object of class DigitAnalysis.

data

A dataframe of right-aligned digits table, preferably from combine_by_columns

Benford_mean

A table for Benford mean in each digit place after removing 0 and/or 5 if desired, preferably from get_benford_mean

max_length

The length of the longest numbers considered. Defaulted to 8.

num_digits

The total number of digits aligned from the right to be analyzed. Defaulted to 5, meaning analyzing digit place 1s to 10ks.

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.

Value

A list of 4 items:

  • expected_mean: A table of expected mean for the dataset data

  • freq_table: The number of left-aligned digit place numbers in each right-aligned digit position in data


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