unif_digits: Goodness of fit for uniform digits

View source: R/unif_digits.R

unif_digitsR Documentation

Goodness of fit for uniform digits

Description

The 'uniform_digits()' function utilizes the 'count_digits()' function to count the number of times that each digit occurs and the 'chisq.test()' function from the stats package to test the assumption that the digits are uniformly distributed. Several other measures of deviation from the uniform distribution are also available.

Usage

unif_digits(
  data,
  variable,
  group = NULL,
  decimal_place = 1,
  measures = c("mad"),
  counts = FALSE
)

Arguments

data

A data frame

variable

A numeric variable that includes the first decimal place.

group

A second variable used to group the primary variable

decimal_place

The decimal place for which digits are counted. The default is set to one but any place may be specified by numeric rank, i.e. "1" for the 1st decimal (tenths), "2" for the 2nd decimal (hundreds), etc.

measures

Measures of the degree to which the data deviates from the uniform distribution.

counts

The default is set as FALSE. If this is changed to TRUE, then results from count_digits will also be included in the output.

Details

This y Leemis, Schmeiser, and Evans (2000) for max. Cho and Gaines (2007), Euclidean distance

Value

A tibble that includes a column called "chisq" that hold the value of the chi-square statistic and a column called "chisq_p" that holds the p-value derived form the chi-square statistic.

Examples

unif_digits(bodyweight, obs, group)



josh-mc/fabricated documentation built on April 25, 2022, 1:31 p.m.