
Calculate the p-value for a permutation test.
pVal(obs, null.dist)
observed value.
vector of values from permutation null distribution.
Eric Archer eric.archer@noaa.gov
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