C.I. Calculator: McNemar¡¦s Chi-Square Test


Data Input: (Help) (Formula) (Examples)  

Test 2 Positive

Test 2 Negative

Totals

Test 1 Positive

Test 1 Negative

Totals

 


Result:

Result

Test Statistic

p-value (1 tail)

p-value (2 tails)

McNemar¡¦s Test

Odds Ratio

 


Note:

Variables

Descriptions

Test 1 Positive

Positive outcome in test 1

Test 1 Negative

Negative outcome in test 1

Test 2 Positive

Positive outcome in test 2

Test 2 Negative

Negative outcome in test 2




Help Aids Top

Application:

McNemar¡¦s Test is a test on a 2x2 contingency table. It checks the marginal homogeneity of two dichotomous variables.

It is used for data of the two groups coming from the same participants, i.e. paired data.

Paired data usually arise through matching, which increased the validity by controlling confounders.

For example, it is used to analyze tests performed before and after treatment in a population.



Procedure:

  1. Enter

a)    Value of 2x2 contingency table tabulating the outcomes of 2 tests

b)    Value of 1-£\, the two-sided confidence level

  1. Click the button ¡§Calculate¡¨ to obtain

a)    Test statistic and p-values (1 tail and 2 tails) of McNemar¡¦s Test

b)    Odds Ratio

3.      Click the button ¡§Reset¡¨ for another new calculation



Formula:

Variables:

Test 2 Positive

Test 2 Negative

Totals

Test 1 Positive

a

b

n1=a+b

Test 1 Negative

c

d

n2=c+d

Totals

m1=a+c

m2=b+d

N=n1+n2

Top

The null hypothesis is

The alternative hypothesis is


The McNemar¡¦s test statistic with Yates' continuity correction is:

         ,with degree of freedom =1

The Odds Ratio is



Notation:

100(1-£\)% confidence interval: We are 100(1-£\)% confident that the true value of the parameter is included in the confidence interval

: The z-value for standard normal distribution with left-tail probability




Examples Top

Example 1

To determine whether a drug has an effect on the disease, the result of diagnosis before and after the treatment is tabulated on a 2x2 contingency table.

 

After: Positive

After: Negative

Totals

Before: Positive

7

13

20

Before: Negative

1

8

9

Totals

8

21

29

Then the test statistic is 8.64286 and the 1-tail and 2-tails p-values are 0.00164 and 0.00328 respectively.

Therefore the null hypothesis is rejected with 5% significance level.

The Odds Ratio is 13.

Example 2: (Matched Case-Control Study)

A study was carried out on post-menopausal women in City A. Cases of women with endometrial cancer were identified from this city. A control group was selected matched to the case on age and lengh of residence in city A. The medical question was whether endometrial cancer was related to estrogen use.

 

Estrogen (Control)

No estrogen (Control)

Totals

Estrogen (Cases)

27

29

56

No Estrogen (Cases)

3

4

7

Totals

30

33

63

The test statistic is 19.53 and the 2-tails p-value is <0.00001. Therefore the null hypothesis is rejected at 5% significance level.

These data show a statistically significant association between estrogen use and endometrial cancer (p<0.0001).

The odds of endometrial cancer is approximately 10 times greater for women who were on estrogen therapy compared to those who were not.

Top