selection {jfa} | R Documentation |
selection()
is used to perform statistical selection of audit samples. It offers flexible implementations of the most common audit sampling algorithms for attributes sampling and monetary unit sampling. selection()
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(data, size, units = c('items', 'values'),
method = c('interval', 'cell', 'random', 'sieve'), values = NULL,
order = NULL, decreasing = FALSE, randomize = FALSE,
replace = FALSE, start = 1)
data |
a data frame containing the population data. |
size |
an integer larger than 0 specifying the number of units to select. Can also be an object of class |
units |
a character specifying the type of sampling units. Possible options are |
method |
a character specifying the sampling algorithm. Possible options are |
values |
a character specifying the name of a column in |
order |
a character specifying the name of a column in |
decreasing |
a logical specifying whether to order the items from smallest to largest. Only used if |
randomize |
a logical specifying if items should be randomly shuffled prior to selection. Note that |
replace |
a logical specifying if sampling units should be selected with replacement. Only used for method |
start |
an integer larger than 0 specifying index of the unit that should be selected. Only used for method |
This section elaborates on the possible options for the units
argument:
items
: In attributes sampling each item in the population is a sampling unit. An item with a book value of $5000 is therefore equally likely to be selected as an item with a book value of $500.
values
: In monetary unit sampling each monetary unit in the population is a sampling unit. An item with a book value of $5000 is therefore ten times more likely to be selected as an item with a book value of $500.
This section elaborates on the possible options for the method
argument:
interval
: In fixed interval sampling the sampling units are divided into a number of equally large intervals. In each interval, a single sampling unit is selected according to a fixed starting point (specified by start
).
cell
: In cell sampling the sampling units in the population are divided into a number (equal to the sample size) of equally large intervals. In each interval, a single sampling unit is selected randomly.
random
: In random sampling all sampling units are drawn with equal probability.
sieve
: In modified sieve sampling items are selected with the largest sieve ratio (Hoogduin, Hall, & Tsay, 2010).
An object of class jfaSelection
containing:
data |
a data frame containing the population data. |
sample |
a data frame containing the selected data sample. |
n.req |
an integer giving the requested sample size. |
n.units |
an integer giving the number of obtained sampling units. |
n.items |
an integer giving the number of obtained sample items. |
N.units |
an integer giving the number of sampling units in the population data. |
N.items |
an integer giving the number of items in the population data. |
interval |
if |
units |
a character indicating the type of sampling units. |
method |
a character indicating the sampling algorithm. |
values |
if |
start |
if |
data.name |
a character indicating the name of the population data. |
Koen Derks, k.derks@nyenrode.nl
Hoogduin, L. A., Hall, T. W., & Tsay, J. J. (2010). Modified sieve sampling: A method for single-and multi-stage probability-proportional-to-size sampling. Auditing: A Journal of Practice & Theory, 29(1), 125-148.
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.
auditPrior
planning
evaluation
report
data("BuildIt")
# Select 100 items using random sampling
selection(data = BuildIt, size = 100, method = "random")
# Select 150 monetary units using fixed interval sampling
selection(
data = BuildIt, size = 150, units = "values",
method = "interval", values = "bookValue"
)