p2pTest: Point to point test of SPD

View source: R/tests.R

p2pTestR Documentation

Point to point test of SPD

Description

Test for evaluating the difference in the summed probability values associated with two points in time.

Usage

p2pTest(x, p1 = NA, p2 = NA, interactive = TRUE, plot = FALSE)

Arguments

x

result of modelTest with raw=TRUE.

p1

calendar year (in BP) of start point.

p2

calendar year (in BP) of end point.

interactive

if set to TRUE enables an interactive selection of p1 and p2 from a graphical display of the SPD. Disabled when p1 and p2 are defined.

plot

if set to TRUE the function plots the location of p1 and p2 on the SPD. Default is FALSE.

Details

The function compares observed differences in the summed probability values associated with two points in time against a distribution of expected values under the null hypothesis defined with the modelTest function. The two points can be specified manually (assigning BP dates to the arguments p1 and p2) or interactively (clicking on a SPD plot). Note that modelTest should be executed setting the argument raw to TRUE (default is FALSE).

Value

A list with: the BP dates for the two points and the p-value obtained from a two-sided test.

References

Edinborough, K., Porcic, M., Martindale, A., Brown, T.J., Supernant, K., Ames, K.M., (2017). Radiocarbon test for demographic events in written and oral history. PNAS 201713012. doi:10.1073/pnas.1713012114

See Also

modelTest.

Examples

## Example with Younger Dryas period Near East, including site bins
## Not run: 
data(emedyd)
caldates <- calibrate(x=emedyd$CRA, errors=emedyd$Error, normalised=FALSE)
bins <- binPrep(sites=emedyd$SiteName, ages=emedyd$CRA, h=50)
nsim=10 #toy example
expnull <- modelTest(caldates, errors=emedyd$Error, bins=bins, nsim=nsim, runm=50,
timeRange=c(16000,9000), model="exponential", datenormalised=FALSE, raw=TRUE)
p2pTest(x=expnull,p1=13000,p2=12500) #non-interactive mode
p2pTest(x=expnull) #interactive mode

## End(Not run)

rcarbon documentation built on Aug. 24, 2023, 5:11 p.m.