You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: Power classes for sample size computation without effect size, i.e. explicit variances #8159
part of #1197
cases where variance can differ between null and alternative or alternatives (in TOST equivalenc)
current context #8138
My original implementation of the Power classes followed the effect size tradition of incorporating standard deviation in the effect size instead of handling it explicitly in the methods of the power classes.
I have added power function for two sample proportion using std_null and std_alternative.
AFAIR, I didn't change power classes to accommodate for it.
example case
power for equivalence test for comparing ratio of 2 poisson or 2 negative binomial random variables
Zhu 2016 and PASS documentation
needs 3 standard deviation null under alternative at lower and upper equivalence margin, and distribution under alternative.
Poisson, NegBin and similar cases follow the same pattern.
I guess I will need classes for power of equivalence tests, separate from those for standard test of equality (or equality with a margin value)
We only support calculating power and sample size(s).
Solving for detectable effectsize is more difficult because we cannot keep variance, std constant when changing effect size in these cases where variance is a function of the mean.
It would be possible if all variance computation are inside the power function. In that case we need classes for the specific case and cannot rely and generic cases as we currently do for normal and t distribution.
We need a generic class with extra helper methods like var_null, var_alt
example power functions for Poisson and Negbin in #8166
Those could be embedded in a distribution and case specific class.
I guess method options could go into the __init__ of the class.
The power method of the class would define the available keywords for rootfinding and delegate to the (standalone) power functions.
Currently we don't have a power function that combines method and "compare" options. see issue #8303
(I'm not yet, sure about the signature of the power function for poisson, binomial, eg. both rates/proportions versus one rate and a value, diff or ratio, under the alternative.
related: what "effect size" should we look for if we want minimum effect for given power, alpha and nobs?
If we use rate1, rate2 (in poisson), then one could be fixed and we find the second.
If we use rate1, diff, then it will not be possible to find detectable "diff" for given rate2, i.e. rate of reference group, unless we reverse labels for treatment and reference group.
possible problem:
diff = rate1 - rate2 could be positive or negative, There is no absolute value and we could have minimum detectable effect in either direction.
Activity
josef-pkt commentedon Feb 28, 2022
We only support calculating power and sample size(s).
Solving for detectable effectsize is more difficult because we cannot keep variance, std constant when changing effect size in these cases where variance is a function of the mean.
It would be possible if all variance computation are inside the power function. In that case we need classes for the specific case and cannot rely and generic cases as we currently do for normal and t distribution.
josef-pkt commentedon Jun 13, 2022
We need a generic class with extra helper methods like var_null, var_alt
example power functions for Poisson and Negbin in #8166
Those could be embedded in a distribution and case specific class.
I guess
methodoptions could go into the__init__of the class.The power method of the class would define the available keywords for rootfinding and delegate to the (standalone) power functions.
Currently we don't have a power function that combines method and "compare" options. see issue #8303
(I'm not yet, sure about the signature of the power function for poisson, binomial, eg. both rates/proportions versus one rate and a
value, diff or ratio, under the alternative.related: what "effect size" should we look for if we want minimum effect for given power, alpha and nobs?
If we use
rate1, rate2(in poisson), then one could be fixed and we find the second.If we use
rate1, diff, then it will not be possible to find detectable "diff" for given rate2, i.e. rate of reference group, unless we reverse labels for treatment and reference group.possible problem:
diff = rate1 - rate2 could be positive or negative, There is no absolute value and we could have minimum detectable effect in either direction.