{{ message }}

# Two Sample Test of Means (Crossover)

Consider a $$2 \times 2M$$ replicated crossover design comparing the means of two treatments, $$\mu_1$$ and $$\mu_2$$. We can rewrite the hypotheses about the two means as a hypothesis about their difference. Define $$\epsilon = \mu_2 - \mu_1$$. To perform the power calculation, we need to estimate the standard deviation of $$\hat{\epsilon}$$, the estimated value of $$\epsilon$$, which we will call $$\sigma_m$$.

Let $$d_{ij}$$ be the observed mean difference in the treatment for the $$i^{th}$$ sequence and $$j^{th}$$ subject where $$i = 1, 2$$ and $$j = 1, \dots, n$$. We can estimate $$\sigma_m$$ by

$\hat{\sigma}_m = \frac{1}{2(n - 1)} \sum^2_{i=1} \sum^n_{j=1} (d_{ij} - \bar{d}_{i\cdot})^2$

where

$\bar{d}_{i\cdot} = \frac{1}{n} \sum^n_{j=1} d_{ij}$

The statistical test used for this set of hypotheses can be a $$t$$-test or a $$z$$-test, depending on if the standard deviation is a known value or estimated from the sample.

## 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.
Mean (Treatment 1)
The estimated mean for treatment 1 ($$\mu_1$$).
Mean (Treatment 2)
The estimated mean for treatment 2 ($$\mu_2$$).
Standard Deviation $$\sigma_m$$
The standard deviation of the estimated difference of the means ($$\sigma_m$$) 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
Known Standard Deviation
If the standard deviation is known or estimated (usually it is estimated).

## Calculation Results

No calculation has been generated yet.

Hypothesis: {{ hypothesis }}

Known Standard Deviation

Unknown Standard Deviation

N Alpha Power Mean (Trt. 1) Mean (Trt. 2) Standard Deviation Margin
{{ val }}