Learn R Programming

jfa (version 0.1.0)

evaluation: Evaluation of Audit Samples using Confidence / Credible Bounds

Description

This function takes a sample data frame or summary statistics about an evaluated audit sample and calculates a confidence bound according to a specified method. The returned object is of class jfaEvaluation and can be used with associated print() and plot() methods.

Usage

evaluation(sample = NULL, bookValues = NULL, auditValues = NULL, 
           confidence = 0.95, nSumstats = NULL, kSumstats = NULL,
           method = "binomial", materiality = NULL, N = NULL, 
           prior = FALSE, nPrior = 0, kPrior = 0, 
           rohrbachDelta = 2.7, momentPoptype = "accounts",
           populationBookValue = NULL, 
           csA = 1, csB = 3, csMu = 0.5)

Arguments

sample

a data frame containing at least a column of book values and a column of audit (true) values.

bookValues

the column name for the book values in the sample.

auditValues

the column name for the audit (true) values in the sample.

confidence

the required confidence level for the bound.

nSumstats

the number of observations in the sample. If specified, overrides the sample, bookValues and auditValues arguments and assumes that the data comes from summary statistics specified by nSumstats and kSumstats.

kSumstats

the sum of the errors found in the sample. If specified, overrides the sample, bookValues and auditValues arguments and assumes that the data comes from summary statistics specified by kSumstats and nSumstats.

method

can be either one of poisson, binomial, hypergeometric, stringer, stringer-meikle, stringer-lta, stringer-pvz, rohrbach, moment, direct, difference, quotient, or regression.

materiality

if specified, the function also returns the conclusion of the analysis with respect to the materiality. This value must be specified as a fraction of the total value of the population (a value between 0 and 1). The value is discarded when direct, difference, quotient, or regression method is chosen.

N

the total population size.

prior

whether to use a prior distribution when evaluating. Defaults to FALSE for frequentist evaluation. If TRUE, the prior distribution is updated by the specified likelihood. Chooses a conjugate gamma distribution for the Poisson likelihood, a conjugate beta distribution for the binomial likelihood, and a conjugate beta-binomial distribution for the hypergeometric likelihood.

nPrior

the prior parameter \(\alpha\) (number of errors in the assumed prior sample).

kPrior

the prior parameter \(\beta\) (total number of observations in the assumed prior sample).

rohrbachDelta

the value of \(\Delta\) in Rohrbach's augmented variance bound.

momentPoptype

can be either one of accounts or inventory. Options result in different methods for calculating the central moments, for more information see Dworin and Grimlund (1986).

populationBookValue

the total value of the audit population. Required when method is one of direct, difference, quotient, or regression.

csA

if method = "coxsnell", the \(\alpha\) parameter of the prior distribution on the mean taint. Default is set to 1, as recommended by Cox and Snell (1979).

csB

if method = "coxsnell", the \(\beta\) parameter of the prior distribution on the mean taint. Default is set to 3, as recommended by Cox and Snell (1979).

csMu

if method = "coxsnell", the mean of the prior distribution on the mean taint. Default is set to 0.5, as recommended by Cox and Snell (1979).

Value

An object of class jfaEvaluation containing:

n

the sample size.

k

an integer specifying the number of observed errors.

t

a number specifying the sum of observed taints.

confidence

the confidence level of the result.

popBookvalue

if specified as input, the total book value of the population.

pointEstimate

if method is one of direct, difference, quotient, or regression, the value of the point estimate.

lowerBound

if method is one of direct, difference, quotient, or regression, the value of the lower bound of the interval.

upperBound

if method is one of direct, difference, quotient, or regression, the value of the upper bound of the interval.

confBound

the upper confidence bound on the error percentage.

method

the evaluation method that was used.

materiality

the materiality.

conclusion

if materiality is specified, the conclusion about whether to approve or not approve the population.

N

if specified as input, the population size.

populationK

the assumed total errors in the population. Used for inferences with hypergeometric method.

prior

a logical, indicating whether a prior was used in the analysis.

nPrior

if a prior is specified, the prior assumed sample size.

kPrior

if a prior is specified, the prior assumed sample errors.

multiplicationFactor

if method = "coxsnell", the multiplication factor for the F-distribution.

df1

if method = "coxsnell", the df1 for the F-distribution.

df2

if method = "coxsnell", the df2 for the F-distribution.

Details

This section lists the available options for the methods argument.

  • poisson: The confidence bound taken from the Poisson distribution. If combined with prior = TRUE, performs Bayesian evaluation using a gamma prior and posterior.

  • binomial: The confidence bound taken from the binomial distribution. If combined with prior = TRUE, performs Bayesian evaluation using a beta prior and posterior.

  • hypergeometric: The confidence bound taken from the hypergeometric distribution. If combined with prior = TRUE, performs Bayesian evaluation using a beta-binomial prior and posterior.

  • stringer: The Stringer bound (Stringer, 1963).

  • stringer-meikle: Stringer bound with Meikle's correction for understatements (Meikle, 1972).

  • stringer-lta: Stringer bound with LTA correction for understatements (Leslie, Teitlebaum, and Anderson, 1979).

  • stringer-pvz: Stringer bound with Pap and van Zuijlen's correction for understatements (Pap and van Zuijlen, 1996).

  • rohrbach: Rohrbach's augmented variance bound (Rohrbach, 1993).

  • moment: Modified moment bound (Dworin and Grimlund, 1986).

  • coxsnell: Cox and Snell bound (Cox and Snell, 1979).

  • direct: Confidence interval using the direct method (Touw and Hoogduin, 2011).

  • difference: Confidence interval using the difference method (Touw and Hoogduin, 2011).

  • quotient: Confidence interval using the quotient method (Touw and Hoogduin, 2011).

  • regression: Confidence interval using the regression method (Touw and Hoogduin, 2011).

References

Cox, D. and Snell, E. (1979). On sampling and the estimation of rare errors. Biometrika, 66(1), 125-132.

Dworin, L., and Grimlund, R. A. (1986). Dollar-unit sampling: A comparison of the quasi-Bayesian and moment bounds. Accounting Review, 36-57.

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.

Meikle, G. R. (1972). Statistical Sampling in an Audit Context: An Audit Technique. Canadian Institute of Chartered Accountants.

Pap, G., and van Zuijlen, M. C. (1996). On the asymptotic behavior of the Stringer bound 1. Statistica Neerlandica, 50(3), 367-389.

Rohrbach, K. J. (1993). Variance augmentation to achieve nominal coverage probability in sampling from audit populations. Auditing, 12(2), 79.

Stringer, K. W. (1963). Practical aspects of statistical sampling in auditing. In Proceedings of the Business and Economic Statistics Section (pp. 405-411). American Statistical Association.

Touw, P., and Hoogduin, L. (2011). Statistiek voor Audit en Controlling. Boom uitgevers Amsterdam.

See Also

auditPrior planning sampling

Examples

Run this code
# NOT RUN {
library(jfa)
set.seed(1)

# Generate some audit data (N = 1000):
data <- data.frame(ID = sample(1000:100000, size = 1000, replace = FALSE), 
                   bookValue = runif(n = 1000, min = 700, max = 1000))

# Using monetary unit sampling, draw a random sample from the population.
s1 <- sampling(population = data, sampleSize = 100, units = "mus", 
               bookValues = "bookValue", algorithm = "random")
s1_sample <- s1$sample
s1_sample$trueValue <- s1_sample$bookValue
s1_sample$trueValue[2] <- s1_sample$trueValue[2] - 500 # One overstatement is found

# Using summary statistics, calculate the upper confidence bound according
# to the binomial distribution:

e1 <- evaluation(nSumstats = 100, kSumstats = 1, method = "binomial", 
                 materiality = 0.05)
print(e1)

# jfa evaluation results for binomial method:
#   
# Materiality:           5% 
# Confidence:            95% 
# Upper bound:           4.656% 
# Sample size:           100 
# Sample errors:         1 
# Sum of taints:         1  
# Conclusion:            Approve population

# Evaluate the raw sample using the stringer bound:

e2 <- evaluation(sample = s1_sample, bookValues = "bookValue", auditValues = "trueValue", 
                 method = "stringer", materiality = 0.05)
print(e2)

# jfa evaluation results for stringer method:
#   
# Materiality:           5% 
# Confidence:            95% 
# Upper bound:           3.952% 
# Sample size:           100 
# Sample errors:         1 
# Sum of taints:         0.587  
# Conclusion:            Approve population

# }

Run the code above in your browser using DataLab