statsmodels.stats.power.TTestIndPower.plot_power

TTestIndPower.plot_power(dep_var='nobs', nobs=None, effect_size=None, alpha=0.05, ax=None, title=None, plt_kwds=None, **kwds)

Plot power with number of observations or effect size on x-axis

Parameters:
dep_var{‘nobs’, ‘effect_size’, ‘alpha’}

This specifies which variable is used for the horizontal axis. If dep_var=’nobs’ (default), then one curve is created for each value of effect_size. If dep_var=’effect_size’ or alpha, then one curve is created for each value of nobs.

nobs{scalar, array_like}

specifies the values of the number of observations in the plot

effect_size{scalar, array_like}

specifies the values of the effect_size in the plot

alpha{float, array_like}

The significance level (type I error) used in the power calculation. Can only be more than a scalar, if dep_var='alpha'

axNone or axis instance

If ax is None, than a matplotlib figure is created. If ax is a matplotlib axis instance, then it is reused, and the plot elements are created with it.

titlestr

title for the axis. Use an empty string, '', to avoid a title.

plt_kwds{None, dict}

not used yet

kwdsdict

These remaining keyword arguments are used as arguments to the power function. Many power function support alternative as a keyword argument, two-sample test support ratio.

Returns:
Figure

If ax is None, the created figure. Otherwise the figure to which ax is connected.

Notes

This works only for classes where the power method has effect_size, nobs and alpha as the first three arguments. If the second argument is nobs1, then the number of observations in the plot are those for the first sample. TODO: fix this for FTestPower and GofChisquarePower

TODO: maybe add line variable, if we want more than nobs and effectsize


Last update: Mar 18, 2024