Skip to main content
Dryad

Code from: Calibrating P-values in ecology: A practical framework for integrating prior plausibility into statistical inference

Data files

Apr 08, 2026 version files 5.22 KB

Click names to download individual files

Abstract

This repository contains R code implementing the p‑value calibration method presented in the associated article. The core function, min_posterior, takes a p‑value and the prior probability of the alternative hypothesis and returns the minimum posterior probability of the null hypothesis, using a Bayes factor calibration based on Sellke et al. (2001). The code includes input checks, example calls for different prior plausibilities, and a short script to visualize how the minimum posterior probability of the null changes as a function of the p‑value for a given prior. This resource is intended as a practical implementation of the theoretical framework in the paper, allowing ecologists to translate conventional p‑values into calibrated measures of evidence that explicitly incorporate prior plausibility.