statistical-power-calculator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseStatistical Power Calculator
Statistical Power计算器
Calculate statistical power and determine required sample sizes for hypothesis testing and experimental design.
计算Statistical Power并确定假设检验和实验设计所需的样本量。
Purpose
用途
Experiment planning for:
- Clinical trial design
- A/B test planning
- Research study sizing
- Survey sample size determination
- Power analysis and validation
适用于以下实验规划场景:
- 临床试验设计
- A/B测试规划
- 研究样本量确定
- 调查样本量计算
- Statistical Power分析与验证
Features
功能特性
- Power Calculation: Calculate statistical power for tests
- Sample Size: Determine required sample size for desired power
- Effect Size: Estimate detectable effect size
- Multiple Tests: t-test, proportion test, ANOVA, chi-square
- Visualizations: Power curves, sample size charts
- Reports: Detailed analysis reports with recommendations
- Statistical Power计算:计算各类检验的Statistical Power
- 样本量确定:根据目标Statistical Power确定所需样本量
- 效应量估算:估算可检测的效应量
- 多类检验支持:t-test、比例检验、ANOVA、卡方检验
- 可视化展示:Statistical Power曲线、样本量图表
- 生成报告:包含建议的详细分析报告
Quick Start
快速开始
python
from statistical_power_calculator import PowerCalculatorpython
from statistical_power_calculator import PowerCalculatorCalculate required sample size
Calculate required sample size
calc = PowerCalculator()
result = calc.sample_size_ttest(
effect_size=0.5,
alpha=0.05,
power=0.8
)
print(f"Required n per group: {result.n_per_group}")
calc = PowerCalculator()
result = calc.sample_size_ttest(
effect_size=0.5,
alpha=0.05,
power=0.8
)
print(f"Required n per group: {result.n_per_group}")
Calculate power
Calculate power
power = calc.power_ttest(n_per_group=100, effect_size=0.5, alpha=0.05)
undefinedpower = calc.power_ttest(n_per_group=100, effect_size=0.5, alpha=0.05)
undefinedCLI Usage
CLI 使用方法
bash
undefinedbash
undefinedCalculate sample size for t-test
Calculate sample size for t-test
python statistical_power_calculator.py --test ttest --effect-size 0.5 --power 0.8
python statistical_power_calculator.py --test ttest --effect-size 0.5 --power 0.8
Calculate power
Calculate power
python statistical_power_calculator.py --test ttest --n 100 --effect-size 0.5
undefinedpython statistical_power_calculator.py --test ttest --n 100 --effect-size 0.5
undefined