Experimental Design Skill: Power and Sample Size Estimation for Two-Sample t-Test

Introduction

When initiating a project or writing a proposal, we often need to answer questions like “How many cases per group are needed to detect an effect with 80% confidence?” or “Is the actual power of the current n sufficient?”. Manually plugging formulas or checking reference tables in textbooks is slow and prone to missing discrepancies in terminology regarding \(\alpha\), effect size, and two-tailed tests. The Skill introduced below integrates power analysis for two-sample t-tests into an Agent workflow: using a predefined JSON to describe parameters, it returns structured results (Markdown provided) from a registered managed executor on SkillHub. This is suitable for quickly checking sample size and power in a chat without setting up a complete statistical environment locally.

What is this

Experimental Design / Experimental design (Coordinate @user_f4fc8899/bio-experimental-design-integrated) is a data-analysis type Skill maintained by community publisher user_f4fc8899 on SkillHub, current version 1.4.20, source community.

Its positioning can be summarized as: performing power analysis for two-sample t-tests — back-calculating sample size per group given effect size, significance level \(\alpha\), and target statistical power, or estimating actual power given sample size \(n\) per group. The official documentation also states that the managed executor registered on SkillHub receives JSON input from the document and returns structured content; Markdown can be attached when needed. It does not run the upstream complete toolchain locally, nor does it manage third-party accounts; the server-side response verified by it is the deliverable.

The SkillHub page displays a rating of 100000 and 703 downloads; tags include pricing_type=alipay and requires_api_key=false (business calls use Alipay pay-per-use instead of an API Key).

Core Features

Combining the SkillHub introduction and SKILL.md within the package, the verified capability boundaries are as follows.

  1. Sample Size Back-calculation: Given parameters like effect size (effectSize), \(\alpha\) (alpha), and target power (power), estimate the sample size required per group for an independent two-sample t-test.
  2. Power Estimation: Given the sample size per group (nPerGroup) and other parameters, estimate the achievable statistical power.
  3. Managed Execution: Perform calculations via registered addresses such as https://fwskillpay-api.cn/v1/pay/skills/bio-experimental-design-integrated/invoke; the Agent orchestrates probe / payment / query and retrieval based on Skill documentation, ultimately delivering the non-empty resource returned by the official service.
  4. Pay-per-use: payment-contract.json and the documentation consistently mark the unit price as ¥0.10/time (CNY), with the Alipay service ID as API_FC3B91AF109D47C8.

The input contract is a top-level JSON object. The registration example given in the documentation is as follows (field meanings are subject to the user’s current request; do not mix in irrelevant context):

{
  "effectSize": 0.5,
  "alpha": 0.05,
  "power": 0.8,
  "nPerGroup": 30
}

Note: The combination of nPerGroup and power depends on whether this is a “back-calculate n” or “calculate power given n”; refer to the managed endpoint’s validation and return for specifics. The Agent should fill in the corresponding fields according to the user’s intent and should not fabricate local calculation results to replace the paid execution result.

Installation and Enablement

SkillHub CLI

If the CLI has not been installed, you can check or install it according to the SkillHub installation documentation (full installation includes the default Skill; --cli-only can be added for CLI-only installation):

command -v skillhub && skillhub --version
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

When installing this Skill, you must use --dir to point to the current Agent’s skills directory; otherwise, the default ./skills/ may not be recognized. The installation syntax in the search index is:

skillhub install bio-experimental-design-integrated --namespace user_f4fc8899 --dir <skills 目录>

Common Agent skills directories (excerpted from SkillHub installation instructions):

Agent skills directory
Cursor ~/.cursor/skills/
Claude Code ~/.claude/skills/
Codex ~/.codex/skills/ or .agents/skills/ under the project
Gemini CLI ~/.gemini/skills/

Installation via Chat

You can also let the Agent read the official installation instructions and pull the coordinate. The prompt form is: According to https://skillhub.cn/install/skillhub.md, install @user_f4fc8899/bio-experimental-design-integrated.

Runtime Dependencies (Paid Path)

SKILL.md inside the package states that paid calls require Node.js 20+ and the host environment’s official Alipay buyer capability (alipay-payment-skill, alipay-bot). Prepare payload.json in the private directory outside the package, connecting to the official buyer CLI via steps like probe, pay, and complete in scripts/skill-paid.mjs; you must not locally fabricate a paid result before the probe obtains a 402 bill. Before transmitting data, you must disclose the complete JSON, the recipient https://fwskillpay-api.cn, the purpose, and the ¥0.10 price to the user and obtain consent.

Typical Usage

The following explains how the Agent should drive the process along the main thread reproducible by the documentation, excluding unverified return values.

  1. Clarify the Task: Confirm that the user is performing a two-sample t-test power problem and collect the effect size, \(\alpha\), target power, or existing \(n\) per group.
  2. Prepare Input: Write payload.json in the private directory; the fields should be consistent with the JSON contract in the previous section. In the example, effectSize: 0.5, alpha: 0.05, power: 0.8, nPerGroup: 30 are the registered examples; actual values are determined by the user’s scenario.
  3. Probe and Pay: Execute after obtaining data transmission and payment authorization (paths relative to the installed skill package):
node scripts/skill-paid.mjs probe --state-dir "<包外私有目录>" --payload-file "<包外私有目录>/payload.json" --confirm-data-transfer
node scripts/skill-paid.mjs pay --state-dir "<同一目录>" --session-id "<当前真实会话>" --intent-summary "原始请求:<本次业务目的摘要>" --confirm-payment
  1. Retrieve Results: When the user completes payment or requests a query, use complete to look up the original order using the bound transaction ID / query ID; only deliver the non-empty resource returned by the official service after verification, and translate the structured result (and optional Markdown) to the user, noting the scope and limitations.

If SkillHub CLI is installed and the environment has online execution permissions, you can also refer to the documentation for skillhub run --skill @user_f4fc8899/bio-experimental-design-integrated; only service-oriented Skills are suitable for this path, subject to the current CLI version behavior.

Regarding triggering: When the user proposes a power/sample size requirement consistent with the introduction, or directly mentions “Experimental Design / Experimental design” or bio-experimental-design-integrated, the Agent should load this Skill.

Suitable Scenarios and Notes

Suitable for: Quickly aligning sample size or power for two-sample t-tests in a chat; willing to use SkillHub managed calculation and accept pay-per-use; relying on official server-side results for proposals or ethics applications (statistical hypotheses still require manual review).

Limitations and Notes:

  • The scope of capability is two-sample t-test power analysis, not general DOE, randomized/block designs, or specialized power models like RNA-seq; more complex experimental designs should use other Skills or professional statistical software.
  • ¥0.10 per call; no paid delivery can be simulated locally without payment. Rules regarding order input retention and 24-hour result expiration are not general DOE, randomized/block designs, or specialized power models like RNA-seq; more complex experimental designs should use other Skills or professional statistical software.
  • ¥0.10 per call; no paid delivery can be simulated locally without payment. Rules regarding order input retention and 24-hour result expiration are in the “Data Transmission and Retention” section of SKILL.md; do not write sensitive data into payload.
  • The managed executor does not replace the legal design approval for peer review or registered trials; key decisions should retain independent statistical review.
  • The paid link relies on binding the Alipay buyer component with the Session ID; the session must not use an order ID or arbitrary strings. When installing directly via skillhub install with CLI, --namespace user_f4fc8899 must be included, consistent with the coordinate @user_f4fc8899/bio-experimental-design-integrated.

Conclusion

Experimental Design / Experimental design condenses the power and sample size issues of two-sample t-tests into a JSON input and a managed response, facilitating quick calculation during the design phase in an Agent. Installation and coordinate refer to SkillHub.

  • SkillHub Page: https://www.skillhub.cn/skills/user_f4fc8899/bio-experimental-design-integrated
  • API Registration Entry (cited in docs): https://api.skillhub.cn/user_f4fc8899/bio-experimental-design-integrated
羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye