MCPower¶
Monte Carlo power analysis for complex statistical models. Instead of relying on closed-form formulas, MCPower simulates thousands of datasets and counts how often your analysis detects real effects.
Two core functions drive every analysis:
find_power()— Given a sample size, estimate statistical powerfind_sample_size()— Find the minimum sample size for a target power level
Note
This is the documentation for the MCPower Python package. If you’re looking for the desktop application, MCPower GUI is a standalone app for Windows, Linux, and macOS with built-in documentation — download it from the releases page. These docs are still useful for understanding how power analysis settings work under the hood.
Install¶
pip install mcpower
Quick Example¶
from mcpower import MCPower
model = MCPower("y = x1 + x2 + x1:x2")
model.set_simulations(400)
model.set_effects("x1=0.5, x2=0.3, x1:x2=0.2")
model.find_power(sample_size=100)
Effects: x1=0.5, x2=0.3, x1:x2=0.2
Model settings applied successfully
================================================================================
MONTE CARLO POWER ANALYSIS RESULTS
================================================================================
Power Analysis Results (N=100):
Test Power Target Status
-------------------------------------------------------------------
overall 100.0 80 ✓
x1 99.5 80 ✓
x2 79.2 80 ✗
x1:x2 50.2 80 ✗
Result: 2/4 tests achieved target power
Getting Started
- Tutorials
- Tutorial: Your First Power Analysis
- Tutorial: Finding the Right Sample Size
- Tutorial: Testing Interactions
- Tutorial: Correlated Predictors
- Tutorial: Power Analysis with Your Own Data
- Tutorial: Preparing Your CSV for MCPower
- Tutorial: ANOVA & Post-Hoc Pairwise Comparisons
- Tutorial: Controlling for Multiple Testing
- Tutorial: Random Intercepts for Clustered Data
- Tutorial: Random Slopes
- Tutorial: Nested Random Effects
- Tutorial: Using test_formula
- Tutorial: Using Custom Scenarios
- Concepts
- API Reference