power-analysis

Calculate statistical power and sample sizes for clinical trial endpoints.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/j-walheim/Critical-AI-Scientist --skill power-analysis-j-walheim
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: power-analysis
Source: https://github.com/j-walheim/Critical-AI-Scientist/tree/main/agent_definition/.claude/skills/power-analysis
Command: npx skills add https://github.com/j-walheim/Critical-AI-Scientist --skill power-analysis-j-walheim

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the critical need for accurate statistical power and sample size estimations in clinical research, ensuring trials are adequately powered to detect meaningful effects while avoiding unnecessary resource expenditure.

Core Features & Use Cases

  • Statistical Power & Sample Size Estimation: Calculates required sample sizes for superiority and non-inferiority trials across binary, continuous, and survival endpoints.
  • Winner's Curse Correction: Incorporates shrinkage factors to adjust effect size estimates based on prior evidence quality, mitigating the overestimation bias common in underpowered studies.
  • Simulation & Visualization: Generates detailed power curves, sample size landscapes, and winner's curse demonstrations to aid in understanding trial design trade-offs.
  • Use Case: When designing a new Phase 3 trial for a novel oncology drug, use this Skill to determine the optimal sample size needed to achieve 80% power to detect a clinically meaningful improvement in overall survival, considering the expected hazard ratio from Phase 2 data.

Quick Start

Use the power-analysis skill to estimate the sample size for a binary superiority trial with a control event rate of 15% and an expected relative risk reduction of 25%.

Frequently Asked Questions about power-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate sample size for a clinical trial with binary, continuous, or survival endpoints?

Sample size calculation for clinical trials requires specifying endpoint types like binary, continuous, or survival data. This Skill computes required sample sizes for superiority and non-inferiority designs while generating interactive power curves and sample size landscapes for visualization.

What is the Winner's Curse in clinical trials and how do I correct for it?

The Winner's Curse in clinical trials is an overestimation bias of effect sizes common in underpowered studies. This Skill applies shrinkage factors to effect size estimates based on prior evidence quality, mitigating this bias when performing statistical power calculations.

How do I estimate statistical power for a Phase 3 oncology trial using Phase 2 data?

Estimating statistical power for a Phase 3 oncology trial involves applying Winner's Curse correction to Phase 2 hazard ratio estimates. This Skill calculates the optimal sample size needed to achieve target power, such as 80%, to detect clinically meaningful improvements in overall survival.

Can I perform non-inferiority sample size calculations for survival endpoints?

Non-inferiority sample size calculations for survival endpoints are fully supported. This Skill handles superiority and non-inferiority trial designs across binary, continuous, and survival data, incorporating shrinkage factors to adjust effect size estimates based on evidence source quality.

What's the best way to visualize power curves and sample size trade-offs in clinical trial design?

Visualizing power curves and sample size trade-offs is handled using Python and Plotly for interactive charting. This Skill generates detailed sensitivity analyses, sample size landscapes, and Winner's Curse demonstrations to aid in understanding clinical trial design constraints.

Why does my underpowered clinical trial overestimate the treatment effect size?

Underpowered clinical trials overestimate treatment effect size due to the Winner's Curse, a statistical bias where only the most extreme positive results achieve significance. Applying shrinkage factors to effect size estimates based on prior evidence quality corrects this overestimation.