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')
selection(population, sampleSize, units = 'records', algorithm = 'random',
bookValues = NULL, intervalStartingPoint = 1, ordered = TRUE,
ascending = TRUE, withReplacement = FALSE, seed = 1)a data frame containing the population of items the auditor wishes to sample from.
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.
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.
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.
a character specifying the name of the column in the population that contains the book values of the items.
if algorithm = 'interval', an integer larger than 0 specifying the starting point of the algorithm.
a logical specifying whether to first order the items in the population according to the value of their bookValues. Defaults to TRUE.
if ordered = TRUE, a logical specifying whether to order the population bookValues from smallest to largest. Defaults to TRUE.
if algorithm = 'random', a logical specifying whether sampling should be performed with replacement. Defaults to FALSE.
if algorithm = 'random' or algorithm = 'cell', an integer specifying a seed to reproduce results. Defaults to 1.
An object of class jfaSelection containing:
a data frame containing the input population.
a data frame containing the selected sample of items.
a character indicating the sampling units that were used to create the selection.
a character indicating the the algorithm that was used to create the selection.
if bookValues is specified, a character indicating the name of the book value column.
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).
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.
# 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