Sunteți pe pagina 1din 20

MCNEMARS

TEST

McNemars

test was first


published in a Psychometrika
article in 1947.
It was
created by Quinn McNemar,
who was a professor in the
Psychology and Statistics
department
at
Stanford
University.
(http://www.statisticssolutions
.com/non-parametric-analysismcnemars-test/)

In

statistics, McNemar's test


is a statistical test used on
paired nominal data. It is
applied to 2 2 contingency
tables with a dichotomous
trait, with matched pairs of
subjects, to determine
whether the row and column
marginal frequencies are
equal
(https://en.wikipedia.org/wiki
/McNemar%27s_test)

Uses of Mcnemars Test


The

McNemar test is used to


analyze pretest-posttest study
designs, as well as being commonly
employed in analyzing matched
pairs and case-control studies.

McNemar's

test is used in many


fields, including the behavioral and
biomedical sciences.

Assumption:

The

McNemar's test has three


assumptions that must be met

Assumption #1: You have one


categorical dependent variable with
two categories (i.e.,a dichotomous
variable) and one categorical
independent variable with two
related groups.

Assumption

#2: The two groups of


your dependent variable must be
mutually exclusive

Assumption

#3: The cases (e.g.,


participants) are a random sample
from the population of interest.

(https://statistics.laerd.com/spsstutorials/mcnemars-test-using-spssstatistics.php)

Pair-Matched Data for Case-Control Study:


outcome is exposure to some risk factor

Paired Data for Before-After


Counts

Null hypotheses for Paired


Data

Hypothesis
Null

hypothesis: Assumes that the


total rows are equal to the sum of
columns. The mean of paired samples
are equal and no (significant) change
has occurred.
Alternative Hypothesis: Assumes
that the total number of rows is not
equal to the total number of columns, or
that the paired sample means are not
equal.

Cells

b and c are called the


discordant cells because they represent
pairs with a difference

Cells

a and d are the concordant


cells. These cells do not contribute any
information about a difference between
pairs or over time so they arent used to
calculate the test statistic

The McNemars Chi-square


statistic is calculated using the
counts in the b and c cells of
the table:
Rule of thumb: b + c 20

If the null hypothesis is true the


McNemar Chi-square statistic = 0.

McNemar statistic distribution


The sampling distribution of the
McNemar statistic is a Chi-square
distribution.

For a test with alpha = 0.05, the


critical value for the McNemar statistic
= 3.84. The null hypothesis is not
rejected if the McNemar statistic < 3.84.

The null hypothesis is rejected if the


McNemar statistic > 3.84.

P-value for McNemar statistic


You can find the p-value for the
McNemar statistic using R
1-pchisq(X2,1)

If the test statistic is > 3.84, the pvalue will be < 0.05 and the null
hypothesis of equal proportions between
pairs or over time will be rejected.

EXAMPLE:

A researcher attempts to determine if a


drug has an effect on a particular
disease. Counts of individuals are given
in the table, with the diagnosis (disease:
present or absent) before treatment
given in the rows, and the diagnosis
after treatment in the columns. The test
requires the same subjects to be
included in the before-and-after
measurements (matched pairs).

After:present After:absent

Row total

101

121

222

Before:absen
59
t

33

92

Column total

154

314

Before:prese
nt

160

In

this example, the null hypothesis of


"marginal homogeneity" would mean
there was no effect of the treatment.
From the above data, the McNemar test
statistic:

has

the value 21.35, which is extremely


unlikely to form the distribution implied
by the null hypothesis (P < 0.001). Thus
the test provides strong evidence to
reject the null hypothesis of no
treatment effect.

S-ar putea să vă placă și