ebm-calculator

Evidence-Based Medicine diagnostic test calculator. Computes sensitivity, specificity, PPV, NPV, likelihood ratios, NNT, and pre/post-test probability from 2x2 contingency table inputs.

53 stars

Best use case

ebm-calculator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Evidence-Based Medicine diagnostic test calculator. Computes sensitivity, specificity, PPV, NPV, likelihood ratios, NNT, and pre/post-test probability from 2x2 contingency table inputs.

Teams using ebm-calculator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ebm-calculator/SKILL.md --create-dirs "https://raw.githubusercontent.com/aipoch/medical-research-skills/main/scientific-skills/Other/ebm-calculator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ebm-calculator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ebm-calculator Compares

Feature / Agentebm-calculatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Evidence-Based Medicine diagnostic test calculator. Computes sensitivity, specificity, PPV, NPV, likelihood ratios, NNT, and pre/post-test probability from 2x2 contingency table inputs.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

> **Source**: [https://github.com/aipoch/medical-research-skills](https://github.com/aipoch/medical-research-skills)
# EBM Calculator

Compute Evidence-Based Medicine statistics from diagnostic test data: sensitivity, specificity, PPV/NPV with prevalence adjustment, likelihood ratios, NNT, and pre/post-test probability conversion.

## Quick Check

```bash
python -m py_compile scripts/main.py
python scripts/main.py --help
```

## When to Use

- Calculating diagnostic test performance metrics from a 2×2 contingency table
- Adjusting PPV/NPV for a specific population prevalence
- Computing NNT from control and experimental event rates
- Converting pre-test probability using a likelihood ratio

## Workflow

1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.
2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.
3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.
4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.
5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.

**Fallback template:** If `scripts/main.py` fails or required inputs are absent, report: (a) which parameters are missing, (b) which metrics can still be computed from available data, (c) the manual formula for the requested mode.

## Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `--mode`, `-m` | string | No | Mode: `diagnostic`, `nnt`, `probability` (default: `diagnostic`) |
| `--tp` | int | diagnostic | True positives (must be ≥ 0) |
| `--fn` | int | diagnostic | False negatives (must be ≥ 0) |
| `--tn` | int | diagnostic | True negatives (must be ≥ 0) |
| `--fp` | int | diagnostic | False positives (must be ≥ 0) |
| `--prevalence`, `-p` | float | No | Disease prevalence 0–1 (adjusts PPV/NPV; must be in [0, 1]) |
| `--control-rate` | float | nnt | Control event rate 0–1 |
| `--experimental-rate` | float | nnt | Experimental event rate 0–1 |
| `--pretest` | float | probability | Pre-test probability 0–1 |
| `--lr` | float | probability | Likelihood ratio |
| `--output`, `-o` | string | No | Output file path (default: stdout) |

**Validation rules:**
- All confusion matrix values (tp, fn, tn, fp) must be ≥ 0; negative values are rejected with: "Confusion matrix values must be non-negative."
- Prevalence must be in [0, 1]; values outside this range are rejected with: "Prevalence must be between 0 and 1."
- The `result` variable is always initialized before `json.dumps(result)` to prevent unbound variable errors.

## Usage

```text
# Diagnostic mode
python scripts/main.py --mode diagnostic --tp 90 --fn 10 --tn 85 --fp 15 --prevalence 0.1

# NNT mode
python scripts/main.py --mode nnt --control-rate 0.3 --experimental-rate 0.2

# Pre/post-test probability
python scripts/main.py --mode probability --pretest 0.15 --lr 5.2
```

## Output Format

```json
{
  "sensitivity": 0.90,
  "specificity": 0.85,
  "ppv": 0.40,
  "npv": 0.99,
  "lr_positive": 6.0,
  "lr_negative": 0.12,
  "interpretation": "High sensitivity; PPV low due to low prevalence"
}
```

## Output Requirements

Every response must make these explicit:

- Objective and deliverable
- Inputs used and assumptions introduced
- Workflow or decision path taken
- Core result: computed EBM metrics
- Constraints, risks, caveats (e.g., prevalence assumptions, population applicability)
- Unresolved items and next-step checks

## Input Validation

This skill accepts: diagnostic test data (2×2 table values, event rates, or pre-test probability + likelihood ratio) for EBM metric calculation.

If the request does not involve EBM statistical calculation — for example, asking for clinical treatment recommendations, drug dosing, or patient-specific medical advice — do not proceed. Instead respond:

> "`ebm-calculator` is designed to compute Evidence-Based Medicine statistics from diagnostic test data. Your request appears to be outside this scope. Please provide the required numeric inputs for your chosen mode, or use a more appropriate tool for your task."

## Error Handling

- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.
- If confusion matrix values are negative, reject with: "Confusion matrix values must be non-negative."
- If prevalence is outside [0, 1], reject with: "Prevalence must be between 0 and 1."
- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.
- If `scripts/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.
- Do not fabricate files, citations, data, search results, or execution outcomes.

## Response Template

1. Objective
2. Inputs Received
3. Assumptions
4. Workflow
5. Deliverable
6. Risks and Limits
7. Next Checks

Related Skills

date-calculator

53
from aipoch/medical-research-skills

Calculate medical date windows including gestational age, estimated delivery dates, and follow-up visit scheduling. Produces structured JSON output for clinical research and trial coordination workflows.

cold-chain-risk-calculator

53
from aipoch/medical-research-skills

Calculate temperature excursion risks for cold chain transport. Assesses route risk, packaging suitability, and monitoring requirements for biological samples and pharmaceuticals requiring controlled-temperature shipping.

buffer-calculator

53
from aipoch/medical-research-skills

Calculate precise buffer recipes with accurate mass and volume measurements for molecular biology and biochemistry. Supports PBS, RIPA, and TAE with concentration scaling, stock solution preparation, pH adjustment guidance, and step-by-step protocols.

bmi-bsa-calculator

53
from aipoch/medical-research-skills

Calculate Body Mass Index (BMI) and Body Surface Area (BSA) for clinical assessment, obesity screening, and chemotherapy dosing. Supports multiple BSA formulas (DuBois, Mosteller, Haycock), WHO weight classification, pediatric calculations, and metric/imperial input.

sample-size-power-calculator

53
from aipoch/medical-research-skills

Advanced sample size and power calculations for complex study designs including survival analysis, clustered designs, and multiple comparisons.

skill-auditor

53
from aipoch/medical-research-skills

A comprehensive auditor for any agent skill — including Manus, OpenClaw/ClawHub, Claude, LobeHub, or custom SKILL.md-based skills. Use this skill whenever a user wants to evaluate, audit, review, score, or quality-check an agent skill before publishing, updating, or deploying. Covers two hard veto gates (structural redlines + research integrity redlines), static quality scoring across 25 criteria (ISO 25010 + OpenSSF + Agent), dynamic test input generation, multi-mode execution testing, multi-layer output evaluation with five specialized category rubrics (Evidence Insight / Protocol Design / Data Analysis / Academic Writing / Other), a Research Veto that applies to all four research categories, human eval viewer generation, actionable P0/P1/P2 optimization recommendations, and automatic skill improvement that outputs a polished, production-ready SKILL.md. Also use whenever a user says "audit my skill", "evaluate my skill", "improve my skill", or wants a corrected version after evaluation.

two-sample-mr-research-planner

53
from aipoch/medical-research-skills

Generates complete two-sample Mendelian randomization (MR) research designs from a user-provided research direction. Use when users want to design, plan, or build a study using two-sample MR to test causal relationships. Triggers:"design a two-sample MR study", "build a publishable MR paper", "test whether this biomarker causally affects this disease", "generate Lite/Standard/Advanced MR plans", "screen multiple exposures with MR", "bidirectional MR design", "causal inference using GWAS summary statistics", or "I want to study X and Y using MR". Always outputs four workload configurations (Lite / Standard / Advanced / Publication+) with a recommended primary plan, step-by-step workflow, figure plan, validation strategy, minimal executable version, and publication upgrade path.

research-proposal-generator

53
from aipoch/medical-research-skills

Generates a comprehensive research proposal design based on input literature, including hypothesis, mechanism verification, and budget. Use when the user wants to design a research project from a paper.

research-grants

53
from aipoch/medical-research-skills

Write competitive research proposals for NSF, NIH, DOE, DARPA, and Taiwan's NSTC when you need agency-compliant narratives, budgets, and review-criteria alignment for a specific solicitation/FOA/BAA.

protocol-standardization

53
from aipoch/medical-research-skills

Standardize fragmented experimental steps into reproducible protocol documents when you need method organization, lab SOP drafting, or cross-operator reproducibility; missing parameters must be explicitly marked as "To be supplemented/Not provided".

prospero-registration-helper

53
from aipoch/medical-research-skills

Assists researchers in generating PROSPERO registration content for meta-analyses from a title and optional protocol. Use when the user wants to draft a PROSPERO registration form.

non-tumor-ml-research-planner

53
from aipoch/medical-research-skills

Generates complete non-tumor biomedical machine learning research designs from a user-provided research direction. Always use this skill when users want to plan bioinformatics + ML papers for non-cancer diseases (metabolic, cardiovascular, kidney, inflammatory, autoimmune, infectious, neurological, endocrine, wound healing, chronic multifactor), design diagnostic biomarker studies, combine GEO datasets with feature selection and ML modeling, or generate Lite/Standard/Advanced/Publication+ workload plans. Trigger for:"non-tumor ML study", "bioinformatics paper outside oncology", "key genes and diagnostic model for a disease", "pyroptosis/ferroptosis/senescence/autophagy + disease", "GEO datasets + machine learning", "RF + LASSO diagnostic model", "DEG + feature selection + validation", "immune infiltration + biomarker", "non-cancer biomarker paper". Trigger even for casual phrasings like "I want to study X using machine learning", "help me design a non-tumor bioinformatics paper", or "how do I build a diagnostic model for disease Y".