I'm confused with statsmodels API of the TTestIndPower class.
In the plot_power
function the number of observations plotted are the total number of samples or the number of samples of each group?
I'm confused with statsmodels API of the TTestIndPower class.
In the plot_power
function the number of observations plotted are the total number of samples or the number of samples of each group?
It's per group.
This is the power_plot I generated with statsmodels
from statsmodels.stats.power import TTestIndPower
panalysis = TTestIndPower()
panalysis.plot_power(
dep_var="nobs",
nobs=np.arange(5, 101),
effect_size=np.arange(0.5, 1.5, .2),
alpha=0.01,
ax=ax,
)
And this is the confirmation with R for an effect size (es) of 0.7
> library(pwr)
> pwr.t.test(power = 0.8, sig.level = 0.01, d = 0.7)
Two-sample t test power calculation
n = 49.35336
d = 0.7
sig.level = 0.01
power = 0.8
alternative = two.sided
NOTE: n is number in *each* group