# ### Sidebar

manual:power_of_nanova

# Power for ANOVA with more than one factor and interaction

Current have problem with multiple effect sizes input. For now, please only input one effect size at a time.

## Description

Power calculation for two-way ANOVA with interaction, three-way ANOVA with interaction for factorial designs.

## Arguments

Among Number of groups, Total sample size, Numerator df, Effect size, significance level, and power, one and only one field can be left blank. We now discuss how to input information for those fields.

As a general example, we consider a three-way ANOVA with three factors A, B, and C. The number of levels (categories) for the three factors is J, K, and L, respectively. For an example, J=3, K=2, L=4.

### Number of Groups

The number of groups is the total number of group in the design calculated by $J\times K\times L$. For the example, the total number of groups is $3\times 2\times 4 = 24$. For two-way ANOVA with the first two factors only, the number of groups is $3\times 2 = 6$

### Total Sample Size

The power calculation assumes the equal sample size for all groups. The total sample size is the product of the number of groups and the sample size for each group. For example, if 5 subjects are in each of the 24 groups, then the total sample size would be $5\times 24=120$.

Multiple sample sizes can be provided in two ways. First, multiple sample sizes can be supplied separated by white spaces, e.g., 100 150 200 will calculate power for the three sample sizes. A sequence of sample sizes can be generated using the method s:e:i with s denoting the starting sample size, e as ending sample size, and i as the interval. For example, 100:150:10 will generate a sequence 100 110 120 130 140 150.

By default, the total sample size is 100.

### Numerator df

The power is calculated based on F distribution which requires the numerator and denominator degrees of freedom. The numerator df depends on the effect to be analyzed.

For the main effect, it is the number of levels - 1. For example, if power is calculated for the main effect of A, then the numerator df is $J-1=3-1=2$. For B and C, the dfs are 1 and 3, respectively.

For the interaction effect, the numerator df is calculated as $(J-1)\times (K-1) \times (L-1)$ for the three-way interaction. For two-way interaction, it is calculated the same way. For example, for the interaction between A and B, the numerator df is $(J-1)\times (K-1)$. Using the example, the numerator df for the three-way interaction of A, B, and C is $(3-1)\times (2-1) \times (4-1) = 6$. For the two-way interaction A by B, B by C, and A by C, the numerator dfs are 2, 3, and 6, respectively.

### Effect Size

The effect size can be calculated based on the effect size calculator.

The effect size is defined using $f$ as in Cohen (1977, p. 274). The $f$ is the ratio between the standard deviation of the effect to be tested $\sigma_m$ and the common standard deviation of the populations $\sigma$ involved such that

$$f = \frac{\sigma_m}{\sigma}$$

The standard deviation $\sigma_m$ is calculated based on the number of groups for the tested effect,

$$\sigma_m = \sqrt{\frac{\sum_{g=1}^{G} (m_i - \bar{m})^2}{G}}$$

The command standard deviation is from the mean variance of all groups $$\sigma = \frac{\sum_{g=1}^{G} s_g^2}{G}$$ where $s_g^2$ is the variance for the $g$th group.

#### Size of Effect

Small Medium Large
.10 .25 .4

#### Effect Size for Two-Way ANOVA

Data are from Maxwell & Delaney (2000, p299).

Desensitization Implosion Insight
MildModerateSevereMildModerateSevereMildModerateSevere
141512101210896
1711101614310610
101210191061278
131092011814129
129111913211117

The sample means ($\mu_{jk}$) and sd ($s_{jk}$) for each group are given below (using the notation in Maxwell & Delaney)

Mild Moderate Severe Average ($\mu_{j.}$) $\alpha_j$
Desensitization 13.2(2.6) 11.4(2.3) 10.4(1.1) 11.67 .82
Implosion 16.8(4.1) 12(1.6) 5.8(3.3) 11.53 .69
Insight 11(2.2) 9(2.5) 8(1.6) 9.33 -1.51
Average ($\mu_{.k}$) 13.67 10.8 8.07 10.84
$\beta_k$ 2.82 -.04 -2.78

We illustrate how to decide the effect size based on the empirical data. To get the effect size, we first need to calculate $\sigma$. It can be calculated as the square root of the average of the variances of all groups. In this case, it would be

$$\sigma =\sqrt{\frac{\sum s_{jk}^2}{JK}} = \sqrt{ \frac{2.6^2+2.3^2+\ldots+1.6^2}{9}} = 2.53$$

Now we move on to the calculation of $\sigma_m$. Suppose we are interested in the main effect of severity. Then, we need to calculate the variance for the factor of severity using the marginal means. That is

$$\sigma_m = \sqrt{\frac{\sum \beta_{k}^2}{3}} = \sqrt{ \frac{1}{3} [(13.67-10.84)^2 + (10.8-10.84)^2 + (8.07-10.84)^2 ] } = 2.29$$

Together, this will give the effect size

$$f = \frac{\sigma_m}{\sigma} = \frac{2.29}{2.53} = 0.9$$

For the interaction effect, we calculate $$(ab)_{jk} = \mu_{jk} - (\mu_{..} + \alpha_j + \beta_k)$$ and then the standard deviation as

$$\sigma_m = \sqrt{ \frac{\sum(ab)_{jk}^2}{JK} }$$

In this example, $\sigma_m = 1.58$. Thus, the effect size is $f=1.58/2.53=.62$.

### Significance Level (alpha)

The significance level (Type I error rate) for power calculation withe the default 0.05.

### Power

The power of the test.

### Power curve

Whether to generate the power curve.

### Note

A note (less than 200 characters) can be provided to provide basic information on the analysis.

## Output

The output lists the related information about this power analysis. The output is given as a matrix.

  n Numerator df Denominator df Effect size # of groups alpha Power
45            2             36        0.81           9  0.05     1

## Examples

### Example 1: Main effect in the two-way anova

  n Numerator df Denominator df Effect size # of groups alpha Power
45            2             36        0.81           9  0.05     1

### Example 2: Interaction effect in the two-way anova

  n Numerator df Denominator df Effect size # of groups alpha Power
45            4             36      0.3844           9  0.05 0.895

## Methods

### Page Tools 