-
Notifications
You must be signed in to change notification settings - Fork 0
/
chap-packages.qmd
59 lines (38 loc) · 4.34 KB
/
chap-packages.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
```{r echo = FALSE, cache = FALSE}
source("utils.R", local = TRUE)
```
# R Packages {#chap-packages}
This chapter discusses other R packages that implement statistical techniques for audit sampling. Such information may be useful for auditors who wish to explore alternative approaches or simply want to confirm the results obtained through the use of the **jfa** package. By exploring these other packages, auditors can gain a greater understanding of the various options available for audit sample planning, selection and evaluation.
## MUS
**MUS** [@MUS] is an R package providing sampling and evaluation methods to apply Monetary Unit Sampling during an audit of financial statements. The package is available via [CRAN](https://cran.r-project.org/package=MUS) and can be downloaded by running the code below. Unlike **jfa**, the **MUS** package provides no functionality for Bayesian audit sampling.
```{r, eval=FALSE}
install.packages("MUS")
```
To show the diffences and similarities between the use of the **MUS** package and the **jfa** package, consider a scenario in which an auditor wants to plan a monetary unit sample such that the sampling risk can be reduced below five percent. The population in this example consists of $N$ = 1000 monetary units and the performance materiality is defined as ten percent (or 100 monetary units). The auditor plans the sample using an expected misstatement rate of one percent (or 10 monetary units).
To compute this sample size, the **MUS** package provides the `MUS.calc.n.conservative()` function, which takes the performance materiality in monetary units as the `tolerable.error` argument, the expected misstatements in monetary units as the `expected.error` argument, and the total number of unit in the population as the `book.value` argument. The resulting sample size is 37.
```{r}
MUS::MUS.calc.n.conservative(tolerable.error = 100, expected.error = 10, book.value = 1000, confidence.level = 0.95)
```
These results can be reproduced in **jfa** using the following command:
```{r}
planning(materiality = 0.1, expected = 0.01, likelihood = "poisson")
```
## samplingbook
**samplingbook** [@samplingbook] is an R package based on the book **Stichproben: Methoden und praktische Umsetzung mit R** [@Kauermann2010] that focuses on survey sampling and statistical analysis of these samples. The package is available via [CRAN](https://cran.r-project.org/package=samplingbook) and can be downloaded by running the code below. Unlike **jfa**, the **samplingbook** package provides limited functionality for auditing as it mainly focuses on survey sampling.
```{r, eval=FALSE}
install.packages("samplingbook")
```
To show the diffences and similarities between the use of the **samplingbook** package and the **jfa** package, consider a scenario in which an auditor wants to evaluate a sample of items and is interested in estimating the 95 percent upper confidence bound. The population in this example consists of $N$ = 300 items and the auditor has inspected a sample of $n$ = 100 items, of which $k$ = 3 contained a misstatement.
To compute the upper bound, the **samplingbook** package provides the `Sprop()` function, which takes the number of found misstatements in the sample as the `m` argument, the sample size as the `n` argument and the population size as the `N` argument. Note that because this function solely computes a two-sided interval for the population misstatement, the 95 percent upper bound can be obtained by using an interval of 90 percent with `level = 0.9`. The resulting upper bound is 0.07.
```{r}
samplingbook::Sprop(m = 3, n = 100, N = 300, level = 0.90)
```
These results can be reproduced in **jfa** using the following command:
```{r}
evaluation(x = 3, n = 100, N.units = 300, method = "hypergeometric", alternative = "less", conf.level = 0.95)
```
## audit
**audit** [@audit] is an R package based on the paper by @Meeden2007 that can be used to find an upper bound for the total amount of overstatement of assets in a set of accounts and estimating the amount of sales tax owed on a collection of transactions. The package is available via [CRAN](https://cran.r-project.org/package=audit) and can be downloaded by running the code below. Unlike **jfa**, The **audit** package provides limited functionality for evaluating audit samples and has no functionality for planning and selection.
```{r, eval=FALSE}
install.packages("audit")
```