{{ message }}

# McNemar's Test for Categorical Shift

Consider an experiment in which a subject can take two states, denoted here as 0 and 1, under two treatments. We can think of the states as 'normal' or 'abnormal'. A categorical shift occurs when observations shift from one state to another between the two treaments. To test the existance of this shift, we use McNemar's Test.

Let $$x_ij$$ be the binary response of the $$i^{th}$$ subject in the $$j^{th}$$ treatment. Define two quantities:

$p_{01} = P(x_{i1} = 0, x_{i2} = 1)$

and

$p_{10} = P(x_{i1} = 1, x_{i2} = 0)$

McNemar's test tests the hypothesis that $$p_{01} = p_{10}$$.

## 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.
$$p_{01}$$
The estimated value of the $$p_{01}$$ defined above.
$$p_{10}$$
The estimated value of the $$p_{01}$$ defined above.

## Calculation Results

No calculation has been generated yet.

N Alpha Power $$p_{01}$$ $$p_{10}$$
{{ val }}