본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트51k · #3577

statistical-power

하는 일

이 도구는 과학 연구에 몇 명의 참가자나 표본이 필요한지 계산하도록 돕습니다. 주어진 참가자 수로 찾아낼 수 있는 가장 작은 효과의 크기도 알려 줄 수 있습니다.

사용하는 경우

  • ✓연구를 시작하기 전에 몇 명을 포함해야 할지 알고 싶을 때.
  • ✓중요한 결과를 찾을 수 있도록 실험을 계획할 때.
  • ✓연구비 신청이나 윤리 승인에서 참가자 수를 설명해야 하는 경우.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/statistical-power/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/statistical-power/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“두 집단 사이의 중간 크기 차이를 찾으려면 몇 명이 필요한가요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

계획한 통계 검정 종류, 중요하다고 생각하는 효과 크기, 원하는 신뢰 수준을 입력합니다. 도구가 필요한 표본 크기나 찾을 수 있는 최소 효과를 계산합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Statistical Power & Sample Size

Overview

Power analysis plans the probability of rejecting a specified null under an assumed alternative. It answers how many independent experimental units are needed to detect a scientifically important effect, or what effects a feasible sample could detect. Choose the inferential goal first: precision, equivalence, noninferiority, or sequential monitoring need their own calculations; the bundled superiority-test helpers do not cover them.

Four quantities are locked together for any given test: sample size (n), effect size, significance level (α), and power (1 − β). For a fixed design, analysis, and nuisance parameters, fixing three permits solving for the fourth when a solution exists. Every calculation in this skill is some rearrangement of that relationship.

This skill covers the two ways to do power analysis:

  • Analytical power calculations (exact under some standard-test assumptions; asymptotic approximations for others) — see references/closed_form_recipes.md.
  • Simulation / Monte Carlo (requires a credible data-generating process and a calibrated planned analysis) — see references/simulation_based_power.md.

For choosing and converting effect sizes — usually the hardest part — see references/effect_sizes.md.

When to Use This Skill

  • Determining required sample size before collecting data (a priori power analysis)
  • Finding the minimum detectable effect (MDE) for a fixed, already-determined sample size
  • Producing power curves (power vs. n, or power vs. effect size) for a grant or protocol
  • Justifying a sample size for an IRB submission, grant, or pre-registration
  • Powering designs with unequal group sizes or non-1:1 allocation
  • Planning complex mixed models, GLMs, clustering, survival, mediation, and interactions through simulation when simpler approximations do not fit
  • Accounting for multiple comparisons, attrition/dropout, or clustering in the sample-size estimate

Installation

The local examples were checked on Python 3.13 with statsmodels 0.15.0, SciPy 1.18.1, NumPy 2.5.3, pandas 2.3.3, and Matplotlib 3.11.2. Use an environment separate from the repository's development environment:

uv venv --python 3.13 .venv-power
uv pip install --python .venv-power/bin/python "statsmodels==0.15.0" "scipy==1.18.1" "numpy==2.5.3" "pandas==2.3.3" "matplotlib==3.11.2"
# Optional comparison / survival methods (also checked for current API use):
uv pip install --python .venv-power/bin/python "pingouin==0.7.0" "lifelines==0.30.3"

On Windows use .venv-power/Scripts/python.exe. Lifelines 0.30.3 requires pandas<3; the tested pin above accommodates it. Mixed models and GLMs are included in statsmodels. Record versions and seeds with the output; numerical smoke tests do not establish a study's effect assumptions or Type I error control.


The one decision that drives everything: the effect size

Power calculations are only as trustworthy as the effect size you feed them. Do not invent a number. Use, in rough order of preference:

  1. A minimally important effect — the smallest effect that would actually change a decision or matter scientifically/clinically (the "smallest effect size of interest", SESOI). This is the most defensible basis: you power to detect what matters, not what you hope to see.
  2. A pilot or prior-study estimate, with uncertainty and selection bias considered. Small pilots are imprecise; publication or significance-based selection can inflate effects. Use a justified uncertainty model or sensitivity range instead of an arbitrary shrinkage factor.
  3. A convention (Cohen's small/medium/large) only as a last resort, and say so explicitly.

Whatever you pick, run a sensitivity analysis: report how required n changes across a plausible range of effect sizes, not a single point. A power analysis presented as one number hides its biggest source of uncertainty. See references/effect_sizes.md for benchmarks and conversions between d, f, r, η², odds ratios, and Cohen's h/w.

…

자주 묻는 질문

'효과 크기'란 무엇인가요?

기대하는 차이나 관계가 얼마나 큰지를 나타내는 값입니다. 효과 크기가 클수록 찾기 쉽습니다.

'통계적 검정력'이란 무엇인가요?

실제 효과가 있을 때 연구가 그 효과를 찾아낼 확률입니다. 보통 연구자들은 80%의 검정력을 목표로 합니다.

이미 끝난 연구에도 이 도구를 쓸 수 있나요?

권장하지 않습니다. 연구가 끝난 뒤 계산하는 검정력(사후 검정력)은 오해를 부를 수 있습니다. 최소 검출 효과를 계산하거나 신뢰구간을 쓰는 것이 더 좋습니다.

상세 정보

작성자의 원본 설명

Calculates sample sizes and statistical power for study planning. Applies when someone asks "how many subjects/samples/replicates do I need", wants an a priori power analysis, a minimum detectable effect (MDE), a power curve, or needs to justify a sample size for a grant, IRB protocol, or pre-registration. Covers closed-form power for t-tests, ANOVA, proportions, correlations, chi-square, and regr

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3577
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬