3.11.17. statsmodels.stats.power

Statistical power, solving for nobs, ... - trial version

Created on Sat Jan 12 21:48:06 2013

Author: Josef Perktold

Example roundtrip - root with respect to all variables

calculated, desired

nobs 33.367204205 33.367204205 effect 0.5 0.5 alpha 0.05 0.05 power 0.8 0.8

TODO: refactoring

  • rename beta -> power, beta (type 2 error is beta = 1-power) DONE
  • I think the current implementation can handle any kinds of extra keywords (except for maybe raising meaningful exceptions
  • streamline code, I think internally classes can be merged how to extend to k-sample tests? user interface for different tests that map to the same (internal) test class
  • sequence of arguments might be inconsistent, arg and/or kwds so python checks what’s required and what can be None.
  • templating for docstrings ?

3.11.17.1. Functions

brentq_expanding(func[, low, upp, args, ...]) find the root of a function in one variable by expanding and brentq
ftest_anova_power(effect_size, nobs, alpha) power for ftest for one way anova with k equal sized groups
ftest_power(effect_size, df_num, df_denom, alpha) Calculate the power of a F-test.
iteritems(obj, **kwargs) replacement for six’s iteritems for Python2/3 compat
normal_power(effect_size, nobs, alpha[, ...]) Calculate power of a normal distributed test statistic
ttest_power(effect_size, nobs, alpha[, df, ...]) Calculate power of a ttest

3.11.17.2. Classes

FTestAnovaPower(**kwds) Statistical Power calculations F-test for one factor balanced ANOVA
FTestPower(**kwds) Statistical Power calculations for generic F-test
GofChisquarePower(**kwds) Statistical Power calculations for one sample chisquare test
NormalIndPower([ddof]) Statistical Power calculations for z-test for two independent samples.
Power(**kwds) Statistical Power calculations, Base Class
TTestIndPower(**kwds) Statistical Power calculations for t-test for two independent sample
TTestPower(**kwds) Statistical Power calculations for one sample or paired sample t-test