random.sampling: Simple Random Sampling for Audit Populations

Description Usage Arguments Value Details Author(s) Examples

Description

This function takes as input a data frame containing an audit population, which needs at least a column indicating the book values of the line items.

Usage

1
random.sampling(data, bookCol, sample.size)

Arguments

data

A data frame containing at least the book values of the audit population.

bookCol

A character indicating the name of the column used for the book values.

sample.size

An integer representing the number of line items to sample.

Value

A data frame containing the sample values.

Details

EMPTY FOR NOW

Author(s)

Koen Derks, k.derks@nyenrode.nl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Create an imaginary data set
bookValues   <- rgamma(n = 2400, shape = 1, rate = 0.001)
error.rate   <- 0.1
error        <- sample(0:1, 2400, TRUE, c(1-error.rate, error.rate))
taint        <- rchisq(n = 2400, df = 1) / 10
auditValues  <- bookValues - (error * taint * bookValues)
frame        <- data.frame( bookValues = round(bookValues,2),
                            auditValues = round(auditValues,2))
# Sample from the population
random.sampling(data = frame,
                bookCol = "bookValues",
                sample.size = 100)

koenderks/auditR documentation built on May 16, 2019, 7:16 p.m.