{{ message }}

# Two Sample Test of Proportions (Crossover)

This calculator calculates power and sample size calculations for 2 by 2$$m$$ crossover study of proportions. Under this design, we are interested in testing hypotheses about $$\epsilon = p_2 - p_1$$ where $$p_1$$ and $$p_2$$ are the proportions from the two groups.

To test hypotheses about $$\epsilon$$, we need to calculate $$d_{ij}$$, the difference in the estimated proportions for the $$j^{th}$$ subject in the $$i^th$$ sequence. $$\hat{\epsilon}$$ is asymtotically normally distributed with mean 0 and variance $$\sigma^2_d$$. We can estimate $$\epsilon$$ and $$\sigma^2_d$$ by $\hat{\epsilon} = \frac{1}{2n} \sum^2_{i=1} \sum^n_{j=1} d_{ij} \text{ and } \hat{\sigma}^2_d = \frac{1}{2(n-1)} \sum^2_{i=1} \sum^n_{j=1} \left( d_{ij} - \bar{d}_{i \cdot} \right)^2$

## 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.
Proportion Difference $$\epsilon$$
The estimated difference of the proportions.
Standard Deviation $$\sigma_d$$
The standard deviation of the estimated difference of the proprotions ($$\sigma_d$$) as 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 }}

N Alpha Power Proportion Difference ($$\epsilon$$) $$\sigma_{d}$$ Margin
{{ val }}