statsmodels.stats.power.normal_sample_size_one_tail¶
-
statsmodels.stats.power.
normal_sample_size_one_tail
(diff, power, alpha, std_null=1.0, std_alternative=None)[source]¶ explicit sample size computation if only one tail is relevant
The sample size is based on the power in one tail assuming that the alternative is in the tail where the test has power that increases with sample size. Use alpha/2 to compute the one tail approximation to the two-sided test, i.e. consider only one tail of two-sided test.
- Parameters
- diff
float
difference in the estimated means or statistics under the alternative.
- power
float
in
interval
(alpha
, 1) number of observations
- alpha
float
in
interval
(0,1) significance level, e.g. 0.05, is the probability of a type I error, that is wrong rejections if the Null Hypothesis is true.
- std_null
float
standard deviation under the Null hypothesis without division by sqrt(nobs)
- std_null
float
standard deviation under the Alternative hypothesis without division by sqrt(nobs)
- diff
- Returns
- nobs
float
sample size to achieve the desired power
- nobs