swfscMisc (version 1.3)

pVal: Permutation Test P-value

Description

Calculate the p-value for a permutation test.

Usage

pVal(obs, null.dist)

Arguments

obs

observed value.

null.dist

vector of values from permutation null distribution.

Examples

Run this code
# NOT RUN {
null.dist <- rnorm(1000)
obs <- rnorm(1, mean = 1)

plot(density(null.dist), xlim = range(c(obs, null.dist)), main = "")
abline(v = obs)
print(obs)
pVal(obs, null.dist)

# }

Run the code above in your browser using DataLab