PG Power
Use when the user asks for sample size, power, detectable effect, or planning assumptions.
Load
Read:
../../references/supervision-gates.md
../../references/pingouin-api-quickref.md
Function Choice
- One-sample, paired, or equal-n two-sample t test ->
pg.power_ttest.
- Unequal independent groups ->
pg.power_ttest2n.
- Between-subject ANOVA ->
pg.power_anova.
- Repeated-measures ANOVA ->
pg.power_rm_anova.
- Correlation ->
pg.power_corr.
Required Inputs
- Target test and design.
- Effect size assumption and source: prior study, smallest effect size of interest, pilot, or convention.
- Alpha.
- Desired power, usually .80 or .90.
- Tail/alternative and allocation ratio where relevant.
- Number of groups or repeated measurements.
Code Patterns
Two-sample t test:
n = pg.power_ttest(d=0.5, n=None, power=0.80,
alpha=0.05, contrast="two-samples")
print(n)
Unequal groups:
power = pg.power_ttest2n(nx=30, ny=45, d=0.5, alpha=0.05)
print(power)
Correlation:
n = pg.power_corr(r=0.3, n=None, power=0.80, alpha=0.05)
print(n)
ANOVA:
n = pg.power_anova(eta_squared=0.06, k=3, n=None,
power=0.80, alpha=0.05)
print(n)
Reporting
State:
- Solved quantity.
- All fixed assumptions.
- Whether n is per group or total. If Pingouin output meaning is uncertain, verify with docs/help and say so.
- Attrition inflation if the user gives expected dropout.
- Sensitivity table for multiple plausible effect sizes when planning is uncertain.
Guardrails
- Do not pretend conventional effect sizes are study-specific evidence.
- Do not compute post hoc power as if it adds evidential value beyond CI/effect size unless the user explicitly requests it.
- For complex mixed/nested designs, Pingouin power functions may be insufficient; recommend simulation or specialized tools.
- End planning answers with one compact S0-S5 audit line where relevant.
1---2name: pg-power3description: Plan psychology study sample sizes or compute achieved power with Pingouin power functions for t tests, ANOVA, repeated-measures ANOVA, and correlations.4---56# PG Power78Use when the user asks for sample size, power, detectable effect, or planning assumptions.910## Load1112Read:1314- `../../references/supervision-gates.md`15- `../../references/pingouin-api-quickref.md`1617## Function Choice1819- One-sample, paired, or equal-n two-sample t test -> `pg.power_ttest`.20- Unequal independent groups -> `pg.power_ttest2n`.21- Between-subject ANOVA -> `pg.power_anova`.22- Repeated-measures ANOVA -> `pg.power_rm_anova`.23- Correlation -> `pg.power_corr`.2425## Required Inputs2627- Target test and design.28- Effect size assumption and source: prior study, smallest effect size of interest, pilot, or convention.29- Alpha.30- Desired power, usually .80 or .90.31- Tail/alternative and allocation ratio where relevant.32- Number of groups or repeated measurements.3334## Code Patterns3536Two-sample t test:3738```python39n = pg.power_ttest(d=0.5, n=None, power=0.80,40 alpha=0.05, contrast="two-samples")41print(n)42```4344Unequal groups:4546```python47power = pg.power_ttest2n(nx=30, ny=45, d=0.5, alpha=0.05)48print(power)49```5051Correlation:5253```python54n = pg.power_corr(r=0.3, n=None, power=0.80, alpha=0.05)55print(n)56```5758ANOVA:5960```python61n = pg.power_anova(eta_squared=0.06, k=3, n=None,62 power=0.80, alpha=0.05)63print(n)64```6566## Reporting6768State:6970- Solved quantity.71- All fixed assumptions.72- Whether n is per group or total. If Pingouin output meaning is uncertain, verify with docs/help and say so.73- Attrition inflation if the user gives expected dropout.74- Sensitivity table for multiple plausible effect sizes when planning is uncertain.7576## Guardrails7778- Do not pretend conventional effect sizes are study-specific evidence.79- Do not compute post hoc power as if it adds evidential value beyond CI/effect size unless the user explicitly requests it.80- For complex mixed/nested designs, Pingouin power functions may be insufficient; recommend simulation or specialized tools.81- End planning answers with one compact S0-S5 audit line where relevant.