AI Agent Hub
Back to skills
Clinical Trial Sample Size & Power Expert icon

Clinical Trial Sample Size & Power Expert

Professional Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Follow https://skillhub.cn/install/skillhub.md to install @user_ff7413f5/ct-samplesize and add the clinical trial sample-size and power capability to your AI assistant.

About this skill

Problem

Clinical trial planning often requires repeated sample-size and power checks across endpoint type, effect size, one- or two-sided tests, and non-inferiority margins. Hand-written R snippets or formula-based calculations can miss parameters, drift across turns, and make it hard to keep power, effect, and n consistent.

How It Works

The skill treats trial designs as 49 --test types and supports bidirectional solving between sample size and power, power curves, and sample-size curves. By default it calls a remote coze R compute service with packages such as rpact and gsDesign, so no local R installation is required. Python is used for argument parsing, deterministic pre-routing, and request assembly.

Structured inputs are accepted directly. Natural-language phrases can be pre-parsed by the --nl route, which extracts the likely test and parameters before sending the request. Ambiguous requests are triaged into Simple, Middle, Complex, and Vague. For complex designs, a level-1 endpoint menu is shown first; for unclear questions, the skill asks a bounded set of questions to lock the endpoint and test. After each calculation, a ## Current Analysis Settings: block is emitted, and follow-up turns should merge the previous settings with the current change using local deterministic logic. --dry-run previews the request envelope, while --show-code can reveal the request JSON or R source.

Boundaries

The workflow sends only trial-design parameters, not patient data, but the researcher still needs to verify effect size, α, power, margins, and population assumptions. It is suitable for protocol drafting and statistical discussion, not as a substitute for a validated statistical plan, regulatory submission package, or governed local calculation pipeline.

Use Cases

  • Calculate required sample size for a non-inferiority survival trial using an HR margin and 80% power.
  • Given a fixed enrollment, reverse-solve achievable power under candidate effect sizes.
  • Compare test types for continuous, binary, and survival endpoints and generate power curves before drafting the SAP.
  • Use adaptive simulation to estimate power, type I error, and expected N for group-sequential designs.

Best For

  • Statistical analysts: trial sample-size calculations across 49 test types without local R.
  • Medical statisticians: convert HR, OR, or mean difference assumptions into sample size or power.
  • Protocol writers: generate power curves and assess whether fixed enrollment is adequate before review.
  • Regulatory or CRO support staff: inspect calculation parameters and preview outbound design data with dry-run.