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 power

  • find_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