{{ message }}

# Multi-Sample Williams Test of Proportions

The multi-sample Williams design is a special case of a crossover design used to compare the means of multiple groups.

Suppose we are interested in comparing groups 1 and 2. Define $$d_{ij}$$ as $$y_{ij1} - y_{ij2}$$ where $$y_{ijl}$$ is the binary response from the $$j^{th}$$ subject in the $$i^{th}$$ sequence from the $$l^{th}$$ group. We can estimate the difference between the means of the two groups by

$\hat{\epsilon} = \frac{1}{kn} \sum^{k}_{i=1} \sum^{n}_{j=1} d_{ij}$

which is normally distributed with mean $$\epsilon$$ and variance $$\sigma^2_d / (kn)$$.

We are able to rewrite the hypothesis test to test $$\epsilon$$ relationship to 0. To perform the power calculation for this hypothesis, we need to calculate

$\hat{\sigma}_d = \frac{1}{k(n - 1)} \sum^{k}_{i=1} \sum^{n}_{j=1} \left( d_{ij} - \frac{1}{n} \sum_{j'=1}^n d_{ij'} \right)^2$

For the purposes of this calculator, we assume that each contrast has the same variance.

## Power Calculation Parameters

To input multiple values, seperate them by a comma.

{{ this.errors }}

## Power Calculation Explanation

Solve For
The unknown you are interested in solving for.
N
The sample size used to test the hypothesis.
Alpha
The $$\alpha$$ (Type I error rate) level of the hypothesis test.
Power
The power (1 - Type II error rate) of the hypothesis test.
Proportions
The proportions of each group seperated by a comma.
Standard Deviation ($$\sigma_d$$)
The standard deviation of the sample, defined above.
Margin
The margin is a value the effect size needs to exceed to be meaningful. For hypotheses of equivalence, the margin must be greater than 0, or the calculation will not be solvable. For one sided tests, a margin is less than 0 implies a non-inferiority hypothesis. Otherwise, a superiority hypothesis is implied. Read More
Hypothesis
There are three types of hypotheses that can be tested: two-sided, one-sided and equivalence. Tests of equivalence must include a margin if the unknown and null means are equal. Read More

## Calculation Results

No calculation has been generated yet.

Hypothesis: {{ hypothesis }}

Proportions: {{ p }}

N Alpha Power Standard Deviation Margin
{{ val }}