depictr.power_curve_plot#
- depictr.power_curve_plot(data, n='n', power='power', group=None, title=None)#
Line plot of statistical power against sample size.
Reads a precomputed tidy table and draws power as a function of sample size, with a dashed reference line at 0.8 (the conventional target). Where the curve crosses the line is the sample size that reaches adequate power. Pass a
groupto overlay one coloured curve per condition (for example several effect sizes or designs).- Parameters:
data (pandas.DataFrame) – A tidy table with one row per sample size (per group, if grouped).
n (str) – Name of the sample-size column.
power (str) – Name of the power column, on the 0-1 scale.
group (str, optional) – A column mapped to colour, one curve per level.
title (str, optional) – Plot title.
- Return type:
plotnine.ggplot
References
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.