Learn R Programming

jfa (version 0.5.7)

selection: Select a statistical audit sample

Description

This function takes a data frame and performs statistical sampling according to one of three algorithms: random sampling, cell sampling, and fixed interval sampling. Sampling is done on the level of two possible sampling units: records or monetary units. The function returns an object of class jfaSelection which can be used with associated summary() and a plot() methods.

For more details on how to use this function, see the package vignette: vignette('jfa', package = 'jfa')

Usage

selection(population, sampleSize, units = 'records', algorithm = 'random',
          bookValues = NULL, intervalStartingPoint = 1, ordered = TRUE, 
          ascending = TRUE, withReplacement = FALSE, seed = 1)

Arguments

population

a data frame containing the population of items the auditor wishes to sample from.

sampleSize

an integer larger than 0 specifying the number of sampling units that need to be selected from the population. Can also be an object of class jfaPlanning.

units

a character specifying the sampling units used. Possible options are records (default) for selection on the level of items or mus for selection on the level of monetary units.

algorithm

a character specifying the sampling algorithm used. Possible options are random (default) for random sampling, cell for cell sampling, or interval for fixed interval sampling.

bookValues

a character specifying the name of the column in the population that contains the book values of the items.

intervalStartingPoint

if algorithm = 'interval', an integer larger than 0 specifying the starting point of the algorithm.

ordered

a logical specifying whether to first order the items in the population according to the value of their bookValues. Defaults to TRUE.

ascending

if ordered = TRUE, a logical specifying whether to order the population bookValues from smallest to largest. Defaults to TRUE.

withReplacement

if algorithm = 'random', a logical specifying whether sampling should be performed with replacement. Defaults to FALSE.

seed

if algorithm = 'random' or algorithm = 'cell', an integer specifying a seed to reproduce results. Defaults to 1.

Value

An object of class jfaSelection containing:

population

a data frame containing the input population.

sample

a data frame containing the selected sample of items.

units

a character indicating the sampling units that were used to create the selection.

algorithm

a character indicating the the algorithm that was used to create the selection.

bookValues

if bookValues is specified, a character indicating the name of the book value column.

Details

The first part of this section elaborates on the two possible options for the units argument:

  • records: In record sampling each item in the population is seen as a sampling unit. An item of $5000 is therefore equally likely to be selected as an item of $500.

  • mus: In monetary unit sampling each monetary unit in the population is seen as a sampling unit. An item of $5000 is therefore ten times more likely to be selected as an item of $500.

The second part of this section elaborates on the three possible options for the algorithm argument:

  • random: In random sampling each sampling unit in the population is drawn with equal probability.

  • cell: In cell sampling the sampling units in the population are divided into a number (equal to the sample size) of intervals. From each interval one sampling unit is selected with equal probability.

  • interval: In fixed interval sampling the sampling units in the population are divided into a number (equal to the sample size) of intervals. From each interval one sampling unit is selected according to a fixed starting point (specified by intervalStartingPoint).

References

Leslie, D. A., Teitlebaum, A. D., & Anderson, R. J. (1979). Dollar-unit Sampling: A Practical Guide for Auditors. Copp Clark Pitman; Belmont, Calif.: distributed by Fearon-Pitman.

Wampler, B., & McEacharn, M. (2005). Monetary-unit sampling using Microsoft Excel. The CPA journal, 75(5), 36.

See Also

auditPrior planning evaluation report auditBF

Examples

Run this code
# NOT RUN {
data('BuildIt')

# Draw a sample of 100 monetary units from the population using
# fixed interval monetary unit sampling
selection(population = BuildIt, sampleSize = 100, 
          algorithm = 'interval', units = 'mus', bookValues = 'bookValue')

# }

Run the code above in your browser using DataLab