@tpmjs/tools-multiple-testing-adjust
Adjust p-values for multiple testing using Bonferroni, Benjamini-Hochberg (BH), or Holm methods. Returns adjusted p-values and indices of significant tests. Use Bonferroni for strict family-wise error control, BH for false discovery rate control, or Holm for a more powerful alternative to Bonferroni.
Test @tpmjs/tools-multiple-testing-adjust (multipleTestingAdjustTool) with AI-powered execution
0/2000 characters
Install this tool and use it with the AI SDK
npm install @tpmjs/tools-multiple-testing-adjustpnpm add @tpmjs/tools-multiple-testing-adjustyarn add @tpmjs/tools-multiple-testing-adjustbun add @tpmjs/tools-multiple-testing-adjustdeno add npm:@tpmjs/tools-multiple-testing-adjustimport { multipleTestingAdjustTool } from '@tpmjs/tools-multiple-testing-adjust';import { generateText } from 'ai';
import { openai } from '@ai-sdk/openai';
import { multipleTestingAdjustTool } from '@tpmjs/tools-multiple-testing-adjust';
const result = await generateText({
model: openai('gpt-4o'),
tools: { multipleTestingAdjustTool },
prompt: 'Your prompt here...',
});
console.log(result.text);Available configuration options
pValuesarrayArray of p-values to adjust (each between 0 and 1)
methodstringAdjustment method: bonferroni (most conservative), bh (Benjamini-Hochberg, controls FDR), or holm (step-down, more powerful than Bonferroni). Default: bonferroni
alphanumberSignificance level (default: 0.05)
Schema extracted: 1/1/2026, 8:18:13 AM
Adjust p-values for multiple testing using Bonferroni, Benjamini-Hochberg (BH), or Holm methods to control family-wise error rate or false discovery rate.
npm install @tpmjs/tools-multiple-testing-adjust
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 // } // }
{ 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 } }
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
MIT
Downloads/month
0
Quality Score