power-analysis

Compute statistical power and sample size for psychological research using Python.

33|6|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill power-analysis-xjtulyc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: power-analysis
Source: https://github.com/xjtulyc/awesome-rosetta-skills/tree/main/skills/11-psychology/power-analysis
Command: npx skills add https://github.com/xjtulyc/awesome-rosetta-skills --skill power-analysis-xjtulyc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, scipy, statsmodels, pingouin, pandas, matplotlib.

What problem does it solve?

This Skill helps you avoid underpowered or overpowered psychological studies by computing the sample size, achieved power, minimum detectable effects, and power for common statistical tests and complex designs.

Core Features & Use Cases

  • A priori, post-hoc, and sensitivity power for t-tests, one-way ANOVA, correlations, and logistic regression using Python.
  • Effect-size-first workflows using common measures (e.g., Cohen’s d, f, r) and conversions to power-ready inputs.
  • Simulation-based power for mixed (between-within) ANOVA and mediation indirect effects, including sequential/alpha-spending planning.

Use cases:

  • Design an RCT in clinical psychology by determining the per-group N needed to reach 80% power at α=0.05 for a hypothesized standardized effect.
  • Estimate mediation power via Monte Carlo simulation when indirect effects are the primary target.
  • Create power curves and sequential testing boundaries to support study planning and adaptive designs.

Quick Start

Use the power-analysis skill to compute the required per-group sample size for a two-sided two-sample t-test with effect_size d=0.55 at alpha=0.05 and power=0.80.

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 psychological study using Python?

To calculate sample size for a psychological study, you compute the required N based on effect size, alpha, and desired power. This Skill handles t-tests, ANOVA, correlations, and logistic regression using statsmodels and pingouin.

How does Monte Carlo simulation work for mediation indirect effects power analysis?

Monte Carlo simulation for mediation power estimates the achieved power of indirect effects by repeatedly sampling the hypothesized model. This Skill applies simulation-based power to mediation indirect effects and mixed ANOVA designs.

Can I use pingouin and statsmodels to compute power for mixed ANOVA designs?

Yes, you can use pingouin to compute power for mixed ANOVA designs. This Skill leverages pingouin for correlation and mixed ANOVA power, alongside statsmodels for t-tests and regression approximations.

What is the difference between a priori, post-hoc, and sensitivity power analysis?

A priori power determines the sample size needed for a target power, post-hoc calculates achieved power from observed effects, and sensitivity computes the minimum detectable effect size. This Skill supports all three workflows.

How do I create power curves and sequential testing boundaries for adaptive designs?

You create power curves and sequential testing boundaries for adaptive designs using the included visualization and plotting utilities. This Skill generates alpha-spending boundaries to support sequential study planning.

Do I need Python and NumPy to run statistical power calculations?

Yes, you need Python with NumPy and SciPy to run statistical power calculations. This Skill also requires statsmodels and pingouin to perform simulations and compute power for complex psychological research designs.