Chi square Test Using SPSS

DrAtharKhan 3,429 views 22 slides Dec 07, 2016
Slide 1
Slide 1 of 22
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22

About This Presentation

A simple way to apply Chi Square test


Slide Content

Using SPSS for Chi Square
Dr Athar Khan
MBBS, MCPS, DPH, DCPS-HCSM, DCPS-HPE, MBA,
PGD-Statistics
Associate Professor
Liaquat College of Medicine & Dentistry

Outline
•Introduction
•Dataset
•Chi-square
•Exercise
12/7/2016 2DR ATHAR KHAN -LCMD

Introduction
•Thechi-squaretestforindependence,also
calledPearson'schi-squaretestorthechi-
squaretestofassociation,isusedto
discoverifthereisarelationshipbetween
twocategoricalvariables.
12/7/2016 3DR ATHAR KHAN -LCMD

BMI
•Bodymassindex(BMI)isameasureofbodyfat
basedonheightandweightthatappliestoboth
adultmenandwomen.
–Under&normalweight:BMI<25
–Overweight&obesity:BMI≥25
12/7/2016 4DR ATHAR KHAN -LCMD

Question 1
•Isthereanyassociationbetweenlivingin
asuburbanareaandbeingoverweight?
–Under&normalweight:BMI<25
–Overweight&obese:BMI≥25
Chi Square test
12/7/2016 5DR ATHAR KHAN -LCMD

Dataset
•30adultsaged18+(malesandfemales)wererecruitedto
studythedifferenceinBMIaccordingtotheirareaof
residence.
•Variables
–Sex(female=1,male=0)
–BMI
–Urbanorrural(urban=0,rural=1)
12/7/2016 6DR ATHAR KHAN -LCMD

Area of Residence
Total
Urban Rural
BMI Categories
Normal and
Underweight
7 11 18
Overweight and
Obesity
10 2 12
Total 17 13 30
12/7/2016 7DR ATHAR KHAN -LCMD

Assumptions
•Assumption#1:
•Twovariablesshouldbemeasuredat
an ordinal or nominal
level(i.e.,categoricaldata).
12/7/2016 8DR ATHAR KHAN -LCMD

Assumptions
•Assumption#2:
•Twovariableshouldconsistoftwoormore
categorical,independentgroups.Example
independentvariablesthatmeetthiscriterion
includegender(2groups:MalesandFemales),
ethnicity(e.g.,3groups:Caucasian,African
AmericanandHispanic),physicalactivitylevel
(e.g.,4groups:sedentary,low,moderateand
high),profession(e.g.,5groups:surgeon,doctor,
nurse,dentist,therapist),andsoforth.
12/7/2016 9DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
•Step1:Statingthenullhypothesis
–H
0:AreaofresidenceandBMIcategoriesare
independent
–H
a:AreaofresidenceandBMIcategoriesare
dependent
OR
–H
0:Thereisnoassociationbetweenlivinginan
urbanareaandbeingoverweight
–H
a:ThereisanassociationbetweenLivinginan
urbanareaandbeingoverweightaredependent
•Step2:Significancelevel
–Alpha=0.05
12/7/2016 10DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
•Step 3: Critical value
–Sampling distribution = χ
2
distribution
–Df = (r-1)(c-1) = 1 (a 2-by-2 table)
–χ
2
(critical) = 3.481
12/7/2016 11DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
•Step 4: Calculated Value
–1. Draw a contingency table.
–2. Enter the Observed frequencies or counts (O)
–3. Calculate totals (in the margins).
Area of Residence
Total
Urban Rural
BMI Categories
Normal and
Underweight
7 11 18
Overweight and
Obesity
10 2 12
Total 17 13 30
12/7/2016 12DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
•Step4:CalculatedValue
•4.CalculatetheExpectedfrequencies(E)a.Foreachcell:Columntotalx
Rowtotal/Nb.WritetheExpectedfrequencyintotheappropriatebox
inthetable.
•CHECK:Expectedfrequencies(E)marginaltotalsarethesameasfor
Observedfrequencies(O)Eyeballthecontingencytable,notingwhere
thedifferencesbetweenO(observed)andE(Expected)valuesoccur.If
theyareclosetoeachother,thelevelsoftheindependent(predictor)variableare
nothavinganeffect.
Area of Residence
Total
Urban Rural
BMI Categories
Normal and
Underweight
7 11 18
Overweight and
Obesity
10 2 12
Total 17 13 30
10.2 7.8
6.8 5.2
12/7/2016 13DR ATHAR KHAN -LCMD

Important Point:
Chi-squarecanbeusedifnomorethan20%of
theexpectedfrequenciesarelessthan5andnone
islessthan1(seenote'a.'atthebottomofSPSS
outputtoseeifthisisaproblem).
Itispossibleto'pool'or'collapse'categoriesinto
fewer,butthismustonlybedoneifitismeaningful
togroupthedatainthisway.
12/7/2016 14DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
Area of Residence
Total
Urban Rural
BMI Categories
Normal and
Underweight
7 11 18
Overweight and
Obesity
10 2 12
Total 17 13 30
10.2 7.8
6.8 5.2
12/7/2016 15DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
O E O-E (O-E)
2
12/7/2016 16DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
•Step 5: Decision
•Step 6: Conclusion
12/7/2016 17DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
Step 4: computing the test statisticin SPSS
12/7/2016 18DR ATHAR KHAN -LCMD

Hypothesis Testing–Step by Step
•Step 5: making a decision and interpreting the
results of the testoverweight_1 * urban Crosstabulation
329 468 797
385.7 411.3 797.0
155 48 203
98.3 104.7 203.0
484 516 1000
484.0 516.0 1000.0
Count
Expected Count
Count
Expected Count
Count
Expected Count
0
1
overweight_1
Total
0 1
urban
Total Chi-Square Tests
79.699
b
1 .000
78.301 1 .000
82.696 1 .000
.000 .000
79.619 1 .000
1000
Pearson Chi-Square
Continuity Correction
a
Likelihood Ratio
Fisher's Exact Test
Linear-by-Linear
Association
N of Valid Cases
Value df
Asymp. Sig.
(2-sided)
Exact Sig.
(2-sided)
Exact Sig.
(1-sided)
Computed only for a 2x2 tablea.
0 cells (.0%) have expected count less than 5. The minimum expected count is 98.
25.
b.
Result

2
obtained)12/7/2016 19DR ATHAR KHAN -LCMD

Exercise
•Does a significant relationship exist between
Gender and BMI categories ?
12/7/2016 20DR ATHAR KHAN -LCMD

BMI Categories * Gender Crosstabulation
Gender
TotalMale Female
BMI Categories
<25
Count 7 11 18
Expected Count 7.2 10.8 18.0
% within Gender58.3% 61.1% 60.0%
>25
Count 5 7 12
Expected Count 4.8 7.2 12.0
% within Gender41.7% 38.9% 40.0%
Total
Count 12 18 30
Expected Count12.0 18.0 30.0
% within Gender100.0%100.0%100.0%
12/7/2016 21DR ATHAR KHAN -LCMD

Chi-Square Tests
Value df
Asymp. Sig.
(2-sided)
Exact Sig. (2-
sided)
Exact Sig.
(1-sided)
Pearson Chi-Square
.023
a
1 .879
Continuity Correction
b
.000 1 1.000
Likelihood Ratio
.023 1 .879
Fisher's Exact Test
1.000 .588
Linear-by-Linear
Association
.022 1 .881
N of Valid Cases
30
a. 1 cells (25.0%) have expected count less than 5. The minimum expected count is
4.80.
b. Computed only for a 2x2 table
12/7/2016 22DR ATHAR KHAN -LCMD
Tags