Nothing Special   »   [go: up one dir, main page]

Mcnemar Test: Dr. Saadah Mohamed Akhir Unit Rundingcara Statistik FSK, Ukm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

McNemar

Test
Dr. Saadah Mohamed Akhir
Unit Rundingcara Statistik
FSK, UKM
Learning Outcomes
 At
the end of the lecture, students will be
able to
 Understand when to use McNemar test.
 Perform McNemar test using SPSS.
 Calculate the McNemar test using formula.
 Interpret and report the output from SPSS.
What is McNemar test?
 Non parametric test
 Categorical data
 a dichotomous (binary) dependent
variable between two related groups.
 paired nominal data
 toanalyze pretest-posttest (before and after)
study designs
Wilcoxon Sign Ranked Test and
McNemar Test – Any difference?
 They do not share the same type of data.
 Wilcoxon – continuous data
 McNemar – categorical data
Assumptions
 Has one categorical dependent variable
with two categories (dichotomous variable)
and one categorical independent variable
with two related groups.
 Dichotomous variable (Binary data) – eg.
Yes and No, Normal and Abnormal.
 Participants are a random sample from the
population.
Example
 Categorical
dependent:
With Training Total
Knowledge status
Knowledge Knowledge
Improved not  yes – improved
Improved

Without Knowledge 10 5 15
 no – not improved
 Two related group
Training Improved

Knowledge
not
Improved
15 20 35
– training status
Total 25 25 50  yes – with
 no - without
Contingency Table
 Organizationof data – table type form
 Variables composed in columns and rows
 Known as cross tabulation table.
With Training Total

Knowledge Knowledge
Improved not
Improved
Without Knowledge 10 5 15
Training Improved
Knowledge 15 20 35
not
Improved
Total 25 25 50
Case Study:
Bilirubin level from experimental drug
- A study was conducted to evaluate the
toxicity side effect of an experimental
therapy.
- Patients (n=86) were treated with the
experimental drug for 3 months.
- Clinical lab measured bilirubin levels of
each patient at baseline and 3 months
after drug is given.
Data - Variables
 Dependent variable – bilirubin level
 Normallevel of bilirubin
 Abnormally high level of bilirubin

 Independent variable – related


groups
 pre – before drug is given
 Post – after drug is given
Data for McNemar statistic test
 Rawdata (n = 86) –  Summarizeddata –
86 data are contingency 2 x 2
entered. table
After
Before
Normal Abnormal

Normal 60 14

Abnormal 6 6
McNemar with SPSS
Raw Data
McNemar - SPSS
 Enterraw data
 Analyze – Non Parametric – Related
Samples
 objective – customize analysis
 Field – move pre test and post test to test
field box
 Click Run
Raw data
Analyze – Non Parametric –
Related Samples
objective – customize analysis
Field – move pre test and post test to
test field box
SPSS - output
McNemar with SPSS
Raw data
SPSS (McNemar)
 Enter raw data in SPSS
 Analyze  Descriptive statistics 
Crosstabs
 Move over the two variables to the row
and column boxes (I used rows for the
pre-test and columns for the post-test)
 Click on Statistics and check McNemar,
then click Continue.
 Click OK.
Raw data
Analyze  Descriptive statistics
 Crosstabs
SPSS
Output
McNemar with SPSS
2 x 2 contingency table
SPSS (McNemar)
 Output from raw data – contingency table
 Weight cases by frequency
 Analyze  Descriptive statistics  Crosstabs
 Move over the two variables to the row and
column boxes (I used rows for the pre-test and
columns for the post-test – it can also be the other
way round)
 Click on Statistics and check McNemar, then click
Continue.
 Click on Cells and then check Row and Column
under Percentages, then click Continue.
 Click OK.
What should be in SPSS?
 Since there are 4 cells in 2 x 2 contingency table –
there are only 4 data entry.
 How many variables? There are 3 variables
 Before
 After
 Frequency

After
Before
Normal Abnormal

Normal 60 14

Abnormal 6 6
Variable View – Data View
Create 3 columns and label

Create 3 Columns – Before,


After, Frequency
-
Label column before
1 as “N” and 2 as “Y”
- Label column after
1 as “N” and 2 as “Y”

Enter n (frequency) data in


column frequency
Variable View – Data View
Enter contingency data in SPSS
Weight Cases by frequency
Weight Cases by frequency
Analyze
McNemar Test
– Test Pairs in SPSS
Output
McNemar - Conduct
statistical decision by using
formula
Case Study:
Bilirubin level from experimental drug
- A study was conducted to evaluate the
toxicity side effect of an experimental
therapy.
- Patients (n=86) were treated with the
experimental drug for 3 months.
- Clinical lab measured bilirubin levels of
each patient at baseline and 3 months
after drug is given.
36

Hypothesis
null hypothesis : H 0 : p1  p2
alt. hypotehsis : H A : p1  p2
Null hypothesis: There is no change in bilirubin
level after taking experimental drug

Alternative hypothesis: There is a change in


bilirubin level after taking experimental drug
Formula
( B  C ) 2
test statistic : 2 
BC
decision rule : reject H 0 if  2 12 ( )

After Responders Non-


Before responders

Responders A B
Non-responder C D
38

McNemar’s test
null hypothesis : H 0 : p1  p2
alt. hypotehsis : H A : p1  p2
( B  C )2
test statistic :  
2

BC
decision rule : reject H 0 if  2 12 ( )

After Responders Non-


Before responders

Responders A B
Non-responder C D
Formula – Calculate
(McNemar)
After
Normal Abnormal High(Y) null hypothesis : H 0 : p1  p2
(N) alt. hypotehsis : H A : p1  p2
Before
(B  C )2
test statistic :  
2

BC
Normal 60 (A) 14 (B) decision rule : reject H 0 if  2 12 ( )
Abnormally
High
6 (C) 6 (D)
- df = 1, the critical value =
3.84 (from the chi-square
- df = (r - 1) (c – 1) = 1
table)
- r = 2, c = 2
- calculated value of 3.20
does not exceeds this value
14 −6 2
- 2 = - there is no significant
14+6 difference in bilirubin level
after therapy
= 3.20
Chi Square table
Report (APA style)
 Eighty six participants were recruited to take
part in the toxicity side effect of an
experimental drug for 3 months. A bilirubin
levels were measured to identify the toxicity
side effect of the experimental drug. Of these,
only 6 had normal bilirubin level after taking
the experimental drug for 3 months. A
McNemar test showed that there is no
significant change of bilirubin level after
taking the experimental drug, 2 (1, N = 86) =
3.20, p = 0.115.
Exercise
THANK YOU

You might also like