Welcome to the ‘Audit sampling’ vignette of thejfapackage. This page provides a straightforward guide to the functions inthe package that are designed to facilitate statistical audit sampling.Specifically, these functions implement standard audit samplingtechniques to calculate sample sizes, select items from a population,and evaluate the misstatement in a data sample compliant withinternational standards on auditing(AmericanInstitute of Certified Public Accountants (AICPA), 2021; InternationalAuditing and Assurance Standards Board (IAASB), 2018; Public CompanyAccounting Oversight Board (PCAOB), 2020). The package allowsenables to specify a prior probability distribution to conduct Bayesianaudit sampling using these functions.
Below you can find an explanation of the available functions injfa, sorted by their occurrence in the standard auditsampling workflow.
TheauditPrior() function is used to specify a priordistribution for Bayesian audit sampling. It enables formal translationof pre-existing audit information into a prior distribution or completecustomization of the prior distribution. The function returns an objectwhich can be used with associatedsummary() andplot() methods. Objects returned by this function can alsobe used as input for theprior argument in other functions.Additionally, these objects have a correspondingpredict()method to generate the predictions of the prior distribution on the datalevel.
For additional details about this function, please refer to thefunctiondocumentation on the package website.
Example usage:
# Beta prior based on inherent risk (70%) and control risk (50%)prior<-auditPrior( method="arm", likelihood="binomial", materiality=0.05, ir=0.7, cr=0.5)summary(prior)#### Prior Distribution Summary#### Options:## Likelihood: binomial## Specifics: ir = 0.7; cr = 0.5; dr = 0.1428571#### Results:## Functional form: beta(α = 1, β = 21)## Mode: 0## Mean: 0.045455## Median: 0.032468## Variance: 0.0018865## Skewness: 1.7442## Information entropy (nat): -2.0921## 95 percent upper bound: 0.13295## Precision: 0.13295Theplanning() function is used to calculate a minimumsample size for audit samples. It allows the specification of approvalconditions for the sample with respect to performance materiality orprecision. The function returns an object which can be used withassociatedsummary() andplot() methods. Toperform Bayesian planning, the input for theprior argumentcan be an object returned by theauditPrior() function, oran object returned byevaluation()$posterior.
For additional details about this function, please refer to thefunctiondocumentation on the package website.
Example usage:
# Poisson likelihoodx<-planning(materiality=0.03, likelihood="poisson")# Default beta prior and binomial likelihoodx<-planning(materiality=0.03, likelihood="binomial", prior=TRUE)# Custom beta prior and binomial likelihoodx<-planning(materiality=0.03, likelihood="binomial", prior=prior)summary(x)#### Bayesian Audit Sample Planning Summary#### Options:## Confidence level: 0.95## Materiality: 0.03## Hypotheses: H₀: Θ > 0.03 vs. H₁: Θ < 0.03## Expected: 0## Likelihood: binomial## Prior distribution: beta(α = 1, β = 21)#### Results:## Minimum sample size: 78## Tolerable errors: 0## Posterior distribution: beta(α = 1, β = 99)## Expected most likely error: 0## Expected upper bound: 0.029807## Expected precision: 0.029807## Expected BF₁₀: 10.018Theselection() function is used to perform statisticalselection of audit samples. It offers flexible implementations of themost common audit sampling algorithms for attributes sampling andmonetary unit sampling. The function returns an object which can be usedwith associatedsummary() andplot() methods.For convenience, the input for thesize argument can be anreturned by theplanning() function.
For additional details about this function, please refer to thefunctiondocumentation on the package website.
Example usage:
# Fixed interval monetary unit samplingx<-selection( data=BuildIt, size=100, units="values", method="interval", values="bookValue")summary(x)#### Audit Sample Selection Summary#### Options:## Requested sample size: 100## Sampling units: monetary units## Method: fixed interval sampling## Starting point: 1#### Data:## Population size: 3500## Population value: 1403221## Selection interval: 14032#### Results:## Selected sampling units: 100## Proportion of value: 0.037014## Selected items: 100## Proportion of size: 0.028571Theevaluation() function accepts a sample or summarystatistics of the sample and performs evaluation according to thespecifiedmethod. The function returns an object which canbe used with associatedsummary() andplot()methods. To perform Bayesian evaluation, the input for theprior argument can be an object returned by theauditPrior() function, or an object returned byevaluation()$posterior.
For additional details about this function, please refer to thefunctiondocumentation on the package website.
Example usage:
# Poisson likelihoodx<-evaluation(x=1, n=100, method="poisson")# Default beta prior and binomial likelihoodx<-evaluation(x=1, n=100, method="binomial", prior=TRUE)# Custom beta prior and binomial likelihoodx<-evaluation(x=1, n=100, method="binomial", prior=prior)summary(x)#### Bayesian Audit Sample Evaluation Summary#### Options:## Confidence level: 0.95## Method: binomial## Prior distribution: beta(α = 1, β = 21)#### Data:## Sample size: 100## Number of errors: 1## Sum of taints: 1#### Results:## Posterior distribution: beta(α = 2, β = 120)## Most likely error: 0.0083333## 95 percent credible interval: [0, 0.038604]## Precision: 0.030271To ensure the accuracy of statistical results,jfaemploys automatedunittests that regularly validate the output from the package againstthe following established benchmarks in the area of audit sampling:
The cheat sheet below will help you get started withjfa’s intended audit sampling workflow. A pdf versioncan be downloadedhere.
