npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tpmjs/tools-multiple-testing-adjust

v0.2.0

Published

Adjust p-values for multiple testing using Bonferroni, Benjamini-Hochberg, or Holm methods

Readme

@tpmjs/tools-multiple-testing-adjust

Adjust p-values for multiple testing using Bonferroni, Benjamini-Hochberg (BH), or Holm methods to control family-wise error rate or false discovery rate.

Installation

npm install @tpmjs/tools-multiple-testing-adjust

Usage

import { multipleTestingAdjustTool } from '@tpmjs/tools-multiple-testing-adjust';

// Use with AI SDK
const result = await multipleTestingAdjustTool.execute({
  pValues: [0.001, 0.02, 0.03, 0.15, 0.8],
  method: 'bh', // 'bonferroni', 'bh', or 'holm'
  alpha: 0.05,
});

console.log(result);
// {
//   adjusted: [0.005, 0.05, 0.05, 0.1875, 0.8],
//   significant: [0, 1, 2],  // Indices of significant tests
//   method: 'bh',
//   alpha: 0.05,
//   metadata: {
//     totalTests: 5,
//     significantCount: 3,
//     originalSignificant: 3
//   }
// }

Parameters

  • pValues (number[], required): Array of p-values to adjust (each between 0 and 1)
  • method (string, optional): Adjustment method - 'bonferroni', 'bh', or 'holm' (default: 'bonferroni')
  • alpha (number, optional): Significance level (default: 0.05)

Returns

{
  adjusted: number[];        // Adjusted p-values in original order
  significant: number[];     // Indices of tests that remain significant
  method: string;            // Method used
  alpha: number;             // Significance level
  metadata: {
    totalTests: number;
    significantCount: number;      // Count after adjustment
    originalSignificant: number;   // Count before adjustment
  }
}

Methods

Bonferroni

  • Most conservative method
  • Controls family-wise error rate (FWER)
  • Multiplies each p-value by the number of tests
  • Use when you need strict control over false positives

Benjamini-Hochberg (BH)

  • Controls false discovery rate (FDR)
  • Less conservative than Bonferroni
  • Better power for large numbers of tests
  • Recommended for exploratory analyses

Holm

  • Step-down procedure
  • Controls FWER like Bonferroni but more powerful
  • Good middle ground between Bonferroni and BH
  • Use when you want FWER control with better power

When to use

  • When performing multiple hypothesis tests simultaneously
  • To avoid inflated Type I error rates
  • In genomics, neuroimaging, A/B testing with multiple variants
  • Any study with multiple comparisons

Example: Comparing methods

const pValues = [0.001, 0.01, 0.02, 0.03, 0.05, 0.1];

// Bonferroni (most strict)
const bonf = await multipleTestingAdjustTool.execute({
  pValues,
  method: 'bonferroni',
});
// significant: [0] - only the smallest p-value survives

// Holm (moderate)
const holm = await multipleTestingAdjustTool.execute({
  pValues,
  method: 'holm',
});
// significant: [0, 1] - two tests survive

// BH (least strict)
const bh = await multipleTestingAdjustTool.execute({
  pValues,
  method: 'bh',
});
// significant: [0, 1, 2, 3] - four tests survive

License

MIT