# Evaluation: Estimating misstatement

## Estimation

When performing estimation the auditor tries to determine the unknown misstatement in the population on the basis of a sample. Generally, estimation implies that there is a minimal amount of assurance to be obtained about the precision / accuracy of your estimate (i.e., the most likely error - the upper bound). This inference about the population misstatement can be performed using the evaluation() function by specifying the min.precision argument and providing the sample data or summary statistics.

### Classical estimation

Suppose your sampling objective is to estimate the misstatement with a precision of 2%. You have planned a sample of n = 188 items from which x = 1 turns out a contain an error. Standard classical evaluation using the Poisson distribution can be performed using the example code below.

result_classical <- evaluation(min.precision = 0.02, method = "poisson", n = 188, x = 1)

Calling the summary() function on the result from the evaluation() function provides the estimates for the most likely error, the 95% upper bound, and the precision.

summary(result_classical)
##
##  Classical Audit Sample Evaluation Summary
##
## Options:
##   Confidence level:               0.95
##   Materiality:                    1
##   Min. precision:                 0.02
##   Method:                         poisson
##
## Data:
##   Sample size:                    188
##   Number of errors:               1
##   Sum of taints:                  1
##
## Results:
##   Most likely error:              0.0053191
##   95 percent confidence interval: [0, 0.025233]
##   Precision:                      0.019914

As we can see, the most likely error in the population is 1 / 188 = 0.53% and the 95% (one-sided) confidence interval ranges from 0% to 2.52%. Consequently, the precision of the estimate is 2.52% - 0.53% = 1.99%. This means that this sample provides sufficient information to estimate the misstatement in the population with a precision of 2%.

### Bayesian estimation

In principle Bayesian estimation follows the same procedure as its classical counterpart, with the exception that a prior distribution must be provided to the evaluation() function. Therefore, the first step is to set up a prior distribution (see also the vignette Prior distributions). For illustration, we will assume a default gamma(1, 1) prior distribution.

prior <- auditPrior(method = "default", likelihood = "poisson")

The sample outcomes together with the prior distribution can then be provided to the evaluation function. Once again, the summary() function provides the estimates for the most likely error, the 95% upper bound, and the precision. Note that, because the prior is already constructed for use with a poisson likelihood, the method argument does not need to be provided to the evaluation() function.

result_bayesian <- evaluation(min.precision = 0.02, n = 188, x = 1, prior = prior)
summary(result_bayesian)
##
##  Bayesian Audit Sample Evaluation Summary
##
## Options:
##   Confidence level:               0.95
##   Materiality:                    1
##   Min. precision:                 0.02
##   Method:                         poisson
##   Prior distribution:             gamma(a = 1, ß = 1)
##
## Data:
##   Sample size:                    188
##   Number of errors:               1
##   Sum of taints:                  1
##
## Results:
##   Posterior distribution:         gamma(a = 2, ß = 189)
##   Most likely error:              0.005291
##   95 percent credible interval:   [0, 0.0251]
##   Precision:                      0.019809

As we can see, the posterior distribution is a gamma(2, 189) distribution. This distribution implies a most likely error in the population is 0.53% and a 95% (one-sided) confidence interval that ranges from 0% to 2.51%. Consequently, the precision of the estimate is 2.51% - 0.53% = 1.98%. Also in the Bayesian framework, this sample provides sufficient information to estimate the misstatement in the population with a precision of 2%.