PresMod: Simulated Random Observation of Traits in Partially Preserved...

Description Usage Arguments Details Value References Examples

View source: R/PresMod.R

Description

A given population consists of a number of individuals/elements, a certain number of which carry a certain trait. These are referred to as 'cases'. The function creates a series of random subsets from this virtual population by drawing a specified number of individuals/elements, simulating random taphonomic processes. The number of iterations (i.e. draws) can be specified.

Usage

1
PresMod(n, c, s, i = 1, value_spec = "count")

Arguments

n

An integer specifying the number of individuals/elements in the population.

c

Cases, i.e. the number or portion of individuals/elements carrying the trait of interest. Depending on the specification of value_spec, c is either given as an integer, expressing the absolute number of cases (value_spec = 'count') or as a decimal value between 0 and 1, expressing the portion of individuals/elements in n that are affected (value_spec = 'portion').

s

Sample, i.e. the number or portion of individuals/elements in the population that are to survive taphonomy. Depending on value specification (value_spec), s is either given as an integer, expressing the absolute number of preserved individuals/elements (value_spec = 'count') or as a decimal value between 0 and 1, expressing the portion of individuals/elements in the population that are preserved (value_spec = 'portion').

i

Integer specifying the number of iterations. By default, only one sample is drawn.

value_spec

The method how c and s are specified, either as absolute counts of cases and preserved individuals/elements or as portions of n. Options are the strings 'count' and 'portion'; the default is 'count'.

Details

A vector of length n is created, consisting of values '0' for individuals not carrying the trait of interest and '1' for cases. For each iteration, a sample of size s is drawn from this vector, using the function sample. The number of cases in these samples (c_count) is determined using the function sum.

The resulting data can be used for modelling the impact of material preservation on the calculation of frequencies. By adapting the parameters to a real population under study, the model can be applied to specific research projects.

Value

A data frame is returned, giving the specified parameters n, c, s and i, and the number of preserved individuals/elements on which the trait of interest could be observed (c_count). The rows of the data frame represent the individual iterations.

References

Waldron T. 1991. Rates for the job: Measures of Disease Frequency in Paleopathology. International Journal of Osteoarchaeology 1(1):17–25.

Waldron T. 2009. Palaeopathology. Cambridge: Cambridge University Press. p. 249-261.

Examples

1
2
3
4
5
6
7
## Specification of sample size and case number as absolute counts
PresMod(n=100, c=9, s=69)
PresMod(n=100, c=9, s=69, i=5)

## Specification of sample size and case number as portions
PresMod(n=100, c=0.09, s=0.69, value_spec="portion")
PresMod(n=100, c=0.09, s=0.69, i=5, value_spec="portion")

cuboideum/deadpop documentation built on Feb. 5, 2021, 11:21 p.m.