# ### Sidebar

manual:power_of_rmanova

# Power for Repeated-Measures ANOVA

## Description

Power calculation for repeated-measures ANOVA for between effect, within effect, and between-within interaction.

## Arguments

Among Number of groups, Number of measurements, Sample size, Effect size, Correlation across measurements, Nonsphericity correction, 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 design with J=3 groups and K=3 repeated measurements.

### Number of Groups

The number of groups is the total number of group or level in the design for the between-subject factor. It should be J=3 use the example here. When the number of group is 1, the analysis becomes to repeated-measures ANOVA.

### Number of Measurements

The number of times the subjects will be measured. K=3 in the example.

### 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 10 subjects are in each of the 3 groups, then the total sample size would be $3\times 10=30$.

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.

### Nonsphericity correction

A repeated measures ANOVA makes the assumption of sphericity that the levels of the within-subjects factors are equal and the correlation among all repeated measures are equal. When this assumption is violated, a correction is required, called the non-sphericity correction. When there is no violation, use the value 1.

### Effect Size

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

The effect size can be calculated in similar ways for two-way ANOVA. The $f$ is the ratio between the standard deviation of the effect to be tested $\sigma_m$ and the within-group variance $\sigma$ involved multiplied by a coefficient $C$ such that

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

The value of $C$ is related to the effect to be calculated. For the between-subject effect,

$$C = \sqrt{\frac{K}{1+(K-1)\rho}}, \text{between effect}$$ For the within-subject effect and the between-within interaction, use $$C = \sqrt{\frac{K}{1-\rho}}, \text{within and between-within effects}$$ where $\rho$ is the correlation across measurements.

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

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

#### Size of Effect

Small Medium Large
.10 .25 .4

Suppose we have the following data:

Time 1 Time 2 Time 3 Average ($\mu_{j.}$) $\alpha_j$
Training 1 13.2 11.4 10.4 11.67 .82
Training 2 16.8 12 5.8 11.53 .69
Control 11 9 8 9.33 -1.51
Average ($\mu_{.k}$) 13.67 10.8 8.07 10.84
$\beta_k$ 2.82 -.04 -2.78

To get the effect size, we first need to get $\sigma$. Suppose in the population, the common standard deviation is 2.53. Furthermore, we assume that the correlation across measurements is 0.7.

We first look the main effect of time. Then, we need to calculate the variance for the factor of time 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} * \sqrt{\frac{K}{1-\rho}}= \frac{2.29}{2.53} * \sqrt{\frac{3}{1-.7}}= 2.85$$

For the interaction effect of the between-subject training and the within-subject time, 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.96$.

### Significance Level (alpha)

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

### Power

The power of the test.

### Type of effect

Power analysis can be conducted for between-subject effect, within-subject effect, and between- and within- interaction effect.

### 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. 