Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Designs rigorous experiments with factorial, fractional factorial, response surface, and optimal designs, plus power analysis.
71% 71%0 ptsof test cases passed
Passed 17 of 24 test cases with the skill, and 17 of 24 without it.
3 of 3 safety checks passed
Not used yet
A skill for designing rigorous experiments using formal Design of Experiments (DOE) methodology. Covers factorial designs, fractional factorials, response surface methods, and optimal design strategies for scientific research.
from scipy import stats
import numpy as np
def power_analysis_ttest(effect_size: float, alpha: float = 0.05,
power: float = 0.80, ratio: float = 1.0) -> dict:
"""
Calculate required sample size for a two-sample t-test.
Args:
effect_size: Cohen's d (expected effect size)
alpha: Significance level
power: Desired statistical power
ratio: Ratio of n2/n1 (for unequal groups)
"""
from statsmodels.stats.power import TTestIndPower
analysis = TTestIndPower()
n1 = analysis.solve_power(
effect_size=effect_size,
alpha=alpha,
power=power,
ratio=ratio,
alternative='two-sided'
)
return {
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.