Calculate `eta` for sample size calculation using power anova

318 views Asked by At

I am using pingouin.power_anova(eta=None, k=None, n=None, power=None, alpha=0.05) in python for the calculation of sample size. I have the information about control_group_historic_mean, control_group_historic_std_deviation and minimum_detectable_effect. I read about the definition of eta from here. But not able to figure out how should i use the given information to calculate eta.

Sorry if I am missing something basic, I am new to statistics.

1

There are 1 answers

0
Sébastien Wieckowski On

The simplest way to deal with eta is to look at the sums of squares (SSs), where eta equals the ratio of the SS between the groups (SSbetween or SSeffect) to the total SS (SSbetween + SSerror).

Obviously you need access to the individual data points in order to compute the variances within and between the groups.

But, you can also reconstruct the ANOVA table from the summary data. SSbetween is the sum of the squared difference between the group mean Yi and the grand mean Y multiplied by the number of values in each group.

For example:

group mean n calculation
A 41 8 8 * (41 - 32.5)²
B 38 8 8 * (38 - 32.5)²
C 14 8 8 * (14 - 32.5)²
D 37 8 8 * (37 - 32.5)²
sum 3720

with the grand mean Y = (41 + 38 + 14 + 37) / 4 = 32.5

For SSerror (also called SSwithin), we don't have access to the individual data points Yij, but we have access to the standard deviation for each group. We know that the variance is the average of the sum of squares, therefore SSwithin is the sum of the squared standard deviation multiplied by the number or values minus 1 in each group as shown below:

group SD n calculation
A 3.5 8 (8 - 1) * 3.5²
B 4.6 8 (8 - 1) * 4.6²
C 3.8 8 (8 - 1) * 3.8²
D 4.9 8 (8 - 1) * 4.9²
sum 503.02

Eta² = 3720 / (3720 + 503.02)