Skip to contents

Compute p-value from null distribution and observed measurement (single value)

Usage

one_sample_perm_test_pval(
  null_dist,
  true_val,
  alternative = c("less", "greater", "two.sided")[1]
)

Arguments

null_dist

vector with the null distribution obtained by shuffling/randomizing (without replacement)

true_val

observed value

alternative

alternative hypothesis, 'less', 'greater' or 'two.sided' (default = 'less')

References

adapted from http://users.stat.umn.edu/~helwig/notes/perm-Notes.pdf (slide 18)