SlideShare a Scribd company logo
Statistics One
Lecture 19
Chi-square tests
Two segments
•  Chi-square goodness of fit
•  Chi-square test of independence

2
Lecture 19 ~ Segment 1
Chi-square goodness of fit
Chi-square tests
•  All of the analyses covered thus far in the
course have assumed that the outcome
variable is a normally distributed continuous
variable
•  Interval variable
•  Ratio variable
4
Chi-square tests
•  What if the outcome variables is
categorical?
–  For example, nominal variables
•  Diagnosis (positive, negative)
•  Verdict (guilty, innocent)
•  Vote (candidate A, candidate B, candidate C)

5
Chi-square tests
•  Chi-square goodness of fit statistic
•  Chi-square test of independence
•  Both can be used in either experimental or
correlational research

6
Chi-square tests
•  Chi-square goodness of fit statistic
–  Determines how well a distribution of
proportions “fits” an expected distribution
–  In election polls, is there a statistically significant
difference in voter preference among candidates?

7
Chi-square tests
•  Chi-square test of independence
–  Determines whether there is a relationship
between two categorical variables
–  In election polls, is there a relationship between
voter gender and preference among candidates?

8
Chi-square goodness of fit
•  New York City mayoral election
–  Assume a small poll was conducted (N=60)
–  Do you intend to vote for:
•  Christine Quinn
•  Joseph Lhota
•  Other

9
Chi-square goodness of fit
Quinn

Lhota
23

Other
12

25

10
Chi-square goodness of fit
•  Null hypothesis
–  Equal proportions

•  Alternative hypothesis
–  Unequal proportions

11
Chi-square goodness of fit
χ2 = Σ [(O - E)2 / E]
O = Observed
E = Expected
df = # of categories – 1
p-value depends on χ2 and df

12
Chi-square goodness of fit

13
Chi-square goodness of fit
To estimate effect size
Cramér’s V (or Phi)
Φc = SQRT(χ2 / N(k – 1))
N = sample size
k = # of categories
14
Chi-square goodness of fit
Quinn

Lhota

Other

20 (E)

20 (E)

20 (E)

23 (O)

12 (O)

25 (O)

15
Chi-square goodness of fit
χ2 = Σ [(O - E)2 / E]
df = # of categories – 1

16
Chi-square goodness of fit
O

E

(O – E)2

(O – E)

(O – E)2 / E

Quinn

23

20

3

9

0.45

Lhota

12

20

-8

64

3.20

Other

25

20

5

25

1.25

Total

60

60

0

98

4.90

17
Chi-square goodness of fit
χ2 = Σ [(O - E)2 / E]
χ2 = 4.90, df = 2
p = .09
∴ Retain the null hypothesis and conclude that the
slight preferences observed here are not statistically
18
Chi-square goodness of fit
To estimate effect size
Cramer’s V (or Phi)
Φc = SQRT(χ2 / N(k – 1))
	

Φc = SQRT(4.90 / 60(3 – 1)) = 0.20
	


19
Dataframe in R (Election)
Voter.ID	
  

Candidate	
  

Gender	
  

1	
  

Quinn	
  

M	
  

2	
  

Quinn	
  

F	
  

3	
  

Other	
  

F	
  

4	
  

Lhota	
  

M	
  

5	
  

Other	
  

M	
  

….	
  

…	
  

…	
  

20
Chi-square goodness of fit in R
> Observed <-- table(Election$Candidate)
> chisq.test(Observed)

21
Chi-square goodness of fit in R

22
Segment summary
•  Chi-square tests are used when outcome
and predictor variables are all categorical
•  Chi-square goodness of fit is an NHST
•  Cramér’s V estimates effect size

23
END SEGMENT
Lecture 19 ~ Segment 2
Chi-square test of independence
Chi-square test of independence
•  Determines whether there is a relationship
between two categorical variables
–  In election polls, is there a relationship between
voter gender and preference among candidates?

26
Chi-square test of independence
•  New York City mayoral election
–  Assume a small poll was conducted (N=200)
–  More males than females (n = 140, n = 60)
–  Do you intend to vote for:
•  Christine Quinn
•  Joseph Lhota
•  Other
27
Chi-square test of independence
Female
Male

Quinn
40
90

Lhota
10
40

Other
10
10

28
Chi-square test of independence
•  Null hypothesis
–  There is no relationship between voter gender
and voter preference

•  Alternative hypothesis
–  There is a relationship between voter gender and
voter preference
29
Chi-square test of independence
χ2 = Σ [(O - E)2 / E]
df = (# of rows - 1) * (# of columns - 1)
p-value depends on χ2 and df

30
Chi-square test of independence

31
Chi-square test of independence
To estimate effect size
Cramér’s V (or Phi)
Φc = SQRT(χ2 / N(k – 1))
N = sample size
k = # of rows or # of categories (whichever is less)
32
Chi-square test of independence
•  Compute the expected frequencies
–  The proportion of male and female voters for
each candidate should be the same as the
overall voter preference rates

33
Chi-square test of independence
•  Compute the expected frequencies
E = (R/N)*C
E: Expected frequency
R: # of entries in the cell’s row
N: total # of entries
C: # of entries in the cell’s column
34
Chi-square test of independence
Quinn
Female
Male
Sum (C)

Lhota
40
90
130

Other
10
40
50

Sum (R)
10
10
20

60
140
200

35
Chi-square test of independence
E = (R/N)*C
Quinn

Lhota

Other

Sum (R)

Female

(60/200)*130
39

(60/200)*50
15

(60/200)*20
6

60

Male

(140/200)*130
91

(140/200)*50
35

(140/200)*20
14

140

Sum (C)

130

50

20

200

36
Chi-square test of independence
O

E

(O – E)2

(O – E)

(O – E)2 / E

F / Quinn

40	
  

39	
  

1	
  

1	
  

F / Lhota

10	
  

15	
  

-­‐5	
  

25	
  

F / Other

10	
  

6	
  

4	
  

16	
  

M / Quinn

90	
  

91	
  

1	
  

1	
  

M / Lhota

40	
  

35	
  

5	
  

25	
  

M / Other

10

14

-4

16

200

200

0

84

Sum

0.03
1.67
2.67
0.01
0.71
1.14
6.23

37
Chi-square test of independence
χ2 = Σ [(O - E)2 / E]
χ2 = 6.23, df = 2
p = .04
∴ Reject the null hypothesis and conclude that the
there is a significant relationship between gender of
38
the defendant and verdict
Chi-square test of independence
To estimate effect size
Cramér’s V (or Phi)
Φc = SQRT(χ2 / N(k – 1))
Φc = SQRT(6.23 / 200(2 – 1)) = .18
39
Dataframe in R (Election)
Voter.ID	
  

Candidate	
  

Gender	
  

1	
  

Quinn	
  

M	
  

2	
  

Quinn	
  

F	
  

3	
  

Other	
  

F	
  

4	
  

Lhota	
  

M	
  

5	
  

Other	
  

M	
  

….	
  

…	
  

…	
  

40
Chi-square test in R
> Observed = table(Election$Candidate, Election$Gender)
> chisq.test(Observed)

41
Chi-square test in R

42
Assumptions
•  Adequate expected cell counts
–  A common rule is 5 or more in all cells of a 2by-2 table, and 5 or more in 80% of cells in
larger tables, and no cells with zero.
–  When this assumption is not met, Fisher’s exact
test, a non-parametric test, is recommended.
43
Assumptions
•  Independence
–  The observations are assumed to be independent of
each other.
–  This means chi-squared cannot be used to test
correlated data (like matched pairs or panel data).
–  In such cases McNemar’s test of dependent
proportions is recommended.	

44
Segment summary
•  Chi-square tests are used when outcome
and predictor variables are all categorical
•  Chi-square test of independence is an NHST
•  Cramér’s V estimates effect size
•  Assumptions
–  Adequate expected cell counts
–  Independence

45
END SEGMENT
END LECTURE 19

More Related Content

Viewers also liked

Stat 130 chi-square goodnes-of-fit test
Stat 130   chi-square goodnes-of-fit testStat 130   chi-square goodnes-of-fit test
Stat 130 chi-square goodnes-of-fit test
Aldrin Lozano
 
Null hypothesis for a chi-square goodness of fit test
Null hypothesis for a chi-square goodness of fit testNull hypothesis for a chi-square goodness of fit test
Null hypothesis for a chi-square goodness of fit test
Ken Plummer
 
Chi square goodness of fit
Chi square goodness of fitChi square goodness of fit
Chi square goodness of fit
Ken Plummer
 
Descriptive and Analytical Epidemiology
Descriptive and Analytical Epidemiology Descriptive and Analytical Epidemiology
Descriptive and Analytical Epidemiology
coolboy101pk
 
Chi square test
Chi square testChi square test
Hypothesis Testing-Z-Test
Hypothesis Testing-Z-TestHypothesis Testing-Z-Test
Hypothesis Testing-Z-TestRoger Binschus
 
DESCRIPTIVE EPIDEMIOLOGY
DESCRIPTIVE EPIDEMIOLOGYDESCRIPTIVE EPIDEMIOLOGY
DESCRIPTIVE EPIDEMIOLOGY
Shyam Chaturvedi
 
Hypothesis testing ppt final
Hypothesis testing ppt finalHypothesis testing ppt final
Hypothesis testing ppt finalpiyushdhaker
 
Hypothesis testing; z test, t-test. f-test
Hypothesis testing; z test, t-test. f-testHypothesis testing; z test, t-test. f-test
Hypothesis testing; z test, t-test. f-test
Shakehand with Life
 

Viewers also liked (14)

Stat 130 chi-square goodnes-of-fit test
Stat 130   chi-square goodnes-of-fit testStat 130   chi-square goodnes-of-fit test
Stat 130 chi-square goodnes-of-fit test
 
Null hypothesis for a chi-square goodness of fit test
Null hypothesis for a chi-square goodness of fit testNull hypothesis for a chi-square goodness of fit test
Null hypothesis for a chi-square goodness of fit test
 
Goodness of fit (ppt)
Goodness of fit (ppt)Goodness of fit (ppt)
Goodness of fit (ppt)
 
Chi square goodness of fit
Chi square goodness of fitChi square goodness of fit
Chi square goodness of fit
 
Descriptive and Analytical Epidemiology
Descriptive and Analytical Epidemiology Descriptive and Analytical Epidemiology
Descriptive and Analytical Epidemiology
 
Chi square test
Chi square testChi square test
Chi square test
 
Z test
Z testZ test
Z test
 
Hypothesis Testing-Z-Test
Hypothesis Testing-Z-TestHypothesis Testing-Z-Test
Hypothesis Testing-Z-Test
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 
DESCRIPTIVE EPIDEMIOLOGY
DESCRIPTIVE EPIDEMIOLOGYDESCRIPTIVE EPIDEMIOLOGY
DESCRIPTIVE EPIDEMIOLOGY
 
Hypothesis testing ppt final
Hypothesis testing ppt finalHypothesis testing ppt final
Hypothesis testing ppt final
 
T test
T testT test
T test
 
Chi square test
Chi square testChi square test
Chi square test
 
Hypothesis testing; z test, t-test. f-test
Hypothesis testing; z test, t-test. f-testHypothesis testing; z test, t-test. f-test
Hypothesis testing; z test, t-test. f-test
 

Similar to Lecture slides stats1.13.l19.air

Chisquared test.pptx
Chisquared test.pptxChisquared test.pptx
Chisquared test.pptx
Krishna Krish Krish
 
Categorical Data and Statistical Analysis
Categorical Data and Statistical AnalysisCategorical Data and Statistical Analysis
Categorical Data and Statistical Analysis
Michael770443
 
Chi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptxChi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptx
ZayYa9
 
Chi sqaure test
Chi sqaure testChi sqaure test
Chi sqaure test
Pritam Kolge
 
7. Chi square test.pdf pharmaceutical biostatistics
7. Chi square test.pdf pharmaceutical biostatistics7. Chi square test.pdf pharmaceutical biostatistics
7. Chi square test.pdf pharmaceutical biostatistics
Jayashritha
 
The Chi-Square Statistic: Tests for Goodness of Fit and Independence
The Chi-Square Statistic: Tests for Goodness of Fit and IndependenceThe Chi-Square Statistic: Tests for Goodness of Fit and Independence
The Chi-Square Statistic: Tests for Goodness of Fit and Independence
jasondroesch
 
Practice test1 solution
Practice test1 solutionPractice test1 solution
Practice test1 solution
Long Beach City College
 
Statistics-Non parametric test
Statistics-Non parametric testStatistics-Non parametric test
Statistics-Non parametric test
Rabin BK
 
Chi square[1]
Chi square[1]Chi square[1]
Chi square[1]
yogesh turkane
 
Analysis of variance (ANOVA)
Analysis of variance (ANOVA)Analysis of variance (ANOVA)
Analysis of variance (ANOVA)
Sneh Kumari
 
Chi square test
Chi square testChi square test
Chi square test
asmhemu
 
Chi square
Chi square Chi square
Chi square
HemamaliniSakthivel
 
Chi squared test
Chi squared testChi squared test
Chi squared test
RabindraAdhikary
 
Top schools in ghaziabad
Top schools in ghaziabadTop schools in ghaziabad
Top schools in ghaziabad
Edhole.com
 
Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida | Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida |
Edhole.com
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
Kalyan Acharjya
 
Chi Square & Anova
Chi Square & AnovaChi Square & Anova
Chi Square & Anova
Birinder Singh Gulati
 
Chi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemarChi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemar
Azmi Mohd Tamil
 

Similar to Lecture slides stats1.13.l19.air (20)

Chisquared test.pptx
Chisquared test.pptxChisquared test.pptx
Chisquared test.pptx
 
Categorical Data and Statistical Analysis
Categorical Data and Statistical AnalysisCategorical Data and Statistical Analysis
Categorical Data and Statistical Analysis
 
Chi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptxChi square distribution and analysis of frequencies.pptx
Chi square distribution and analysis of frequencies.pptx
 
Chi sqaure test
Chi sqaure testChi sqaure test
Chi sqaure test
 
7. Chi square test.pdf pharmaceutical biostatistics
7. Chi square test.pdf pharmaceutical biostatistics7. Chi square test.pdf pharmaceutical biostatistics
7. Chi square test.pdf pharmaceutical biostatistics
 
The Chi-Square Statistic: Tests for Goodness of Fit and Independence
The Chi-Square Statistic: Tests for Goodness of Fit and IndependenceThe Chi-Square Statistic: Tests for Goodness of Fit and Independence
The Chi-Square Statistic: Tests for Goodness of Fit and Independence
 
Practice test1 solution
Practice test1 solutionPractice test1 solution
Practice test1 solution
 
Statistics-Non parametric test
Statistics-Non parametric testStatistics-Non parametric test
Statistics-Non parametric test
 
Chi square[1]
Chi square[1]Chi square[1]
Chi square[1]
 
Analysis of variance (ANOVA)
Analysis of variance (ANOVA)Analysis of variance (ANOVA)
Analysis of variance (ANOVA)
 
Chi square test
Chi square test Chi square test
Chi square test
 
More tabs
More tabsMore tabs
More tabs
 
Chi square test
Chi square testChi square test
Chi square test
 
Chi square
Chi square Chi square
Chi square
 
Chi squared test
Chi squared testChi squared test
Chi squared test
 
Top schools in ghaziabad
Top schools in ghaziabadTop schools in ghaziabad
Top schools in ghaziabad
 
Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida | Top schools in India | Delhi NCR | Noida |
Top schools in India | Delhi NCR | Noida |
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 
Chi Square & Anova
Chi Square & AnovaChi Square & Anova
Chi Square & Anova
 
Chi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemarChi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemar
 

More from atutor_te

Lecture slides stats1.13.l24.air
Lecture slides stats1.13.l24.airLecture slides stats1.13.l24.air
Lecture slides stats1.13.l24.air
atutor_te
 
Lecture slides stats1.13.l22.air
Lecture slides stats1.13.l22.airLecture slides stats1.13.l22.air
Lecture slides stats1.13.l22.air
atutor_te
 
Lecture slides stats1.13.l21.air
Lecture slides stats1.13.l21.airLecture slides stats1.13.l21.air
Lecture slides stats1.13.l21.air
atutor_te
 
Lecture slides stats1.13.l20.air
Lecture slides stats1.13.l20.airLecture slides stats1.13.l20.air
Lecture slides stats1.13.l20.air
atutor_te
 
Lecture slides stats1.13.l18.air
Lecture slides stats1.13.l18.airLecture slides stats1.13.l18.air
Lecture slides stats1.13.l18.air
atutor_te
 
Lecture slides stats1.13.l17.air
Lecture slides stats1.13.l17.airLecture slides stats1.13.l17.air
Lecture slides stats1.13.l17.air
atutor_te
 
Lecture slides stats1.13.l16.air
Lecture slides stats1.13.l16.airLecture slides stats1.13.l16.air
Lecture slides stats1.13.l16.air
atutor_te
 
Lecture slides stats1.13.l15.air
Lecture slides stats1.13.l15.airLecture slides stats1.13.l15.air
Lecture slides stats1.13.l15.air
atutor_te
 
Lecture slides stats1.13.l14.air
Lecture slides stats1.13.l14.airLecture slides stats1.13.l14.air
Lecture slides stats1.13.l14.air
atutor_te
 
Lecture slides stats1.13.l13.air
Lecture slides stats1.13.l13.airLecture slides stats1.13.l13.air
Lecture slides stats1.13.l13.air
atutor_te
 
Lecture slides stats1.13.l12.air
Lecture slides stats1.13.l12.airLecture slides stats1.13.l12.air
Lecture slides stats1.13.l12.air
atutor_te
 
Lecture slides stats1.13.l11.air
Lecture slides stats1.13.l11.airLecture slides stats1.13.l11.air
Lecture slides stats1.13.l11.air
atutor_te
 
Lecture slides stats1.13.l10.air
Lecture slides stats1.13.l10.airLecture slides stats1.13.l10.air
Lecture slides stats1.13.l10.air
atutor_te
 
Lecture slides stats1.13.l09.air
Lecture slides stats1.13.l09.airLecture slides stats1.13.l09.air
Lecture slides stats1.13.l09.air
atutor_te
 
Lecture slides stats1.13.l08.air
Lecture slides stats1.13.l08.airLecture slides stats1.13.l08.air
Lecture slides stats1.13.l08.air
atutor_te
 
Lecture slides stats1.13.l07.air
Lecture slides stats1.13.l07.airLecture slides stats1.13.l07.air
Lecture slides stats1.13.l07.air
atutor_te
 
Lecture slides stats1.13.l06.air
Lecture slides stats1.13.l06.airLecture slides stats1.13.l06.air
Lecture slides stats1.13.l06.air
atutor_te
 
Lecture slides stats1.13.l05.air
Lecture slides stats1.13.l05.airLecture slides stats1.13.l05.air
Lecture slides stats1.13.l05.air
atutor_te
 
Lecture slides stats1.13.l04.air
Lecture slides stats1.13.l04.airLecture slides stats1.13.l04.air
Lecture slides stats1.13.l04.air
atutor_te
 
Lecture slides stats1.13.l23.air
Lecture slides stats1.13.l23.airLecture slides stats1.13.l23.air
Lecture slides stats1.13.l23.air
atutor_te
 

More from atutor_te (20)

Lecture slides stats1.13.l24.air
Lecture slides stats1.13.l24.airLecture slides stats1.13.l24.air
Lecture slides stats1.13.l24.air
 
Lecture slides stats1.13.l22.air
Lecture slides stats1.13.l22.airLecture slides stats1.13.l22.air
Lecture slides stats1.13.l22.air
 
Lecture slides stats1.13.l21.air
Lecture slides stats1.13.l21.airLecture slides stats1.13.l21.air
Lecture slides stats1.13.l21.air
 
Lecture slides stats1.13.l20.air
Lecture slides stats1.13.l20.airLecture slides stats1.13.l20.air
Lecture slides stats1.13.l20.air
 
Lecture slides stats1.13.l18.air
Lecture slides stats1.13.l18.airLecture slides stats1.13.l18.air
Lecture slides stats1.13.l18.air
 
Lecture slides stats1.13.l17.air
Lecture slides stats1.13.l17.airLecture slides stats1.13.l17.air
Lecture slides stats1.13.l17.air
 
Lecture slides stats1.13.l16.air
Lecture slides stats1.13.l16.airLecture slides stats1.13.l16.air
Lecture slides stats1.13.l16.air
 
Lecture slides stats1.13.l15.air
Lecture slides stats1.13.l15.airLecture slides stats1.13.l15.air
Lecture slides stats1.13.l15.air
 
Lecture slides stats1.13.l14.air
Lecture slides stats1.13.l14.airLecture slides stats1.13.l14.air
Lecture slides stats1.13.l14.air
 
Lecture slides stats1.13.l13.air
Lecture slides stats1.13.l13.airLecture slides stats1.13.l13.air
Lecture slides stats1.13.l13.air
 
Lecture slides stats1.13.l12.air
Lecture slides stats1.13.l12.airLecture slides stats1.13.l12.air
Lecture slides stats1.13.l12.air
 
Lecture slides stats1.13.l11.air
Lecture slides stats1.13.l11.airLecture slides stats1.13.l11.air
Lecture slides stats1.13.l11.air
 
Lecture slides stats1.13.l10.air
Lecture slides stats1.13.l10.airLecture slides stats1.13.l10.air
Lecture slides stats1.13.l10.air
 
Lecture slides stats1.13.l09.air
Lecture slides stats1.13.l09.airLecture slides stats1.13.l09.air
Lecture slides stats1.13.l09.air
 
Lecture slides stats1.13.l08.air
Lecture slides stats1.13.l08.airLecture slides stats1.13.l08.air
Lecture slides stats1.13.l08.air
 
Lecture slides stats1.13.l07.air
Lecture slides stats1.13.l07.airLecture slides stats1.13.l07.air
Lecture slides stats1.13.l07.air
 
Lecture slides stats1.13.l06.air
Lecture slides stats1.13.l06.airLecture slides stats1.13.l06.air
Lecture slides stats1.13.l06.air
 
Lecture slides stats1.13.l05.air
Lecture slides stats1.13.l05.airLecture slides stats1.13.l05.air
Lecture slides stats1.13.l05.air
 
Lecture slides stats1.13.l04.air
Lecture slides stats1.13.l04.airLecture slides stats1.13.l04.air
Lecture slides stats1.13.l04.air
 
Lecture slides stats1.13.l23.air
Lecture slides stats1.13.l23.airLecture slides stats1.13.l23.air
Lecture slides stats1.13.l23.air
 

Recently uploaded

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 

Recently uploaded (20)

TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 

Lecture slides stats1.13.l19.air

  • 2. Two segments •  Chi-square goodness of fit •  Chi-square test of independence 2
  • 3. Lecture 19 ~ Segment 1 Chi-square goodness of fit
  • 4. Chi-square tests •  All of the analyses covered thus far in the course have assumed that the outcome variable is a normally distributed continuous variable •  Interval variable •  Ratio variable 4
  • 5. Chi-square tests •  What if the outcome variables is categorical? –  For example, nominal variables •  Diagnosis (positive, negative) •  Verdict (guilty, innocent) •  Vote (candidate A, candidate B, candidate C) 5
  • 6. Chi-square tests •  Chi-square goodness of fit statistic •  Chi-square test of independence •  Both can be used in either experimental or correlational research 6
  • 7. Chi-square tests •  Chi-square goodness of fit statistic –  Determines how well a distribution of proportions “fits” an expected distribution –  In election polls, is there a statistically significant difference in voter preference among candidates? 7
  • 8. Chi-square tests •  Chi-square test of independence –  Determines whether there is a relationship between two categorical variables –  In election polls, is there a relationship between voter gender and preference among candidates? 8
  • 9. Chi-square goodness of fit •  New York City mayoral election –  Assume a small poll was conducted (N=60) –  Do you intend to vote for: •  Christine Quinn •  Joseph Lhota •  Other 9
  • 10. Chi-square goodness of fit Quinn Lhota 23 Other 12 25 10
  • 11. Chi-square goodness of fit •  Null hypothesis –  Equal proportions •  Alternative hypothesis –  Unequal proportions 11
  • 12. Chi-square goodness of fit χ2 = Σ [(O - E)2 / E] O = Observed E = Expected df = # of categories – 1 p-value depends on χ2 and df 12
  • 14. Chi-square goodness of fit To estimate effect size Cramér’s V (or Phi) Φc = SQRT(χ2 / N(k – 1)) N = sample size k = # of categories 14
  • 15. Chi-square goodness of fit Quinn Lhota Other 20 (E) 20 (E) 20 (E) 23 (O) 12 (O) 25 (O) 15
  • 16. Chi-square goodness of fit χ2 = Σ [(O - E)2 / E] df = # of categories – 1 16
  • 17. Chi-square goodness of fit O E (O – E)2 (O – E) (O – E)2 / E Quinn 23 20 3 9 0.45 Lhota 12 20 -8 64 3.20 Other 25 20 5 25 1.25 Total 60 60 0 98 4.90 17
  • 18. Chi-square goodness of fit χ2 = Σ [(O - E)2 / E] χ2 = 4.90, df = 2 p = .09 ∴ Retain the null hypothesis and conclude that the slight preferences observed here are not statistically 18
  • 19. Chi-square goodness of fit To estimate effect size Cramer’s V (or Phi) Φc = SQRT(χ2 / N(k – 1)) Φc = SQRT(4.90 / 60(3 – 1)) = 0.20 19
  • 20. Dataframe in R (Election) Voter.ID   Candidate   Gender   1   Quinn   M   2   Quinn   F   3   Other   F   4   Lhota   M   5   Other   M   ….   …   …   20
  • 21. Chi-square goodness of fit in R > Observed <-- table(Election$Candidate) > chisq.test(Observed) 21
  • 22. Chi-square goodness of fit in R 22
  • 23. Segment summary •  Chi-square tests are used when outcome and predictor variables are all categorical •  Chi-square goodness of fit is an NHST •  Cramér’s V estimates effect size 23
  • 25. Lecture 19 ~ Segment 2 Chi-square test of independence
  • 26. Chi-square test of independence •  Determines whether there is a relationship between two categorical variables –  In election polls, is there a relationship between voter gender and preference among candidates? 26
  • 27. Chi-square test of independence •  New York City mayoral election –  Assume a small poll was conducted (N=200) –  More males than females (n = 140, n = 60) –  Do you intend to vote for: •  Christine Quinn •  Joseph Lhota •  Other 27
  • 28. Chi-square test of independence Female Male Quinn 40 90 Lhota 10 40 Other 10 10 28
  • 29. Chi-square test of independence •  Null hypothesis –  There is no relationship between voter gender and voter preference •  Alternative hypothesis –  There is a relationship between voter gender and voter preference 29
  • 30. Chi-square test of independence χ2 = Σ [(O - E)2 / E] df = (# of rows - 1) * (# of columns - 1) p-value depends on χ2 and df 30
  • 31. Chi-square test of independence 31
  • 32. Chi-square test of independence To estimate effect size Cramér’s V (or Phi) Φc = SQRT(χ2 / N(k – 1)) N = sample size k = # of rows or # of categories (whichever is less) 32
  • 33. Chi-square test of independence •  Compute the expected frequencies –  The proportion of male and female voters for each candidate should be the same as the overall voter preference rates 33
  • 34. Chi-square test of independence •  Compute the expected frequencies E = (R/N)*C E: Expected frequency R: # of entries in the cell’s row N: total # of entries C: # of entries in the cell’s column 34
  • 35. Chi-square test of independence Quinn Female Male Sum (C) Lhota 40 90 130 Other 10 40 50 Sum (R) 10 10 20 60 140 200 35
  • 36. Chi-square test of independence E = (R/N)*C Quinn Lhota Other Sum (R) Female (60/200)*130 39 (60/200)*50 15 (60/200)*20 6 60 Male (140/200)*130 91 (140/200)*50 35 (140/200)*20 14 140 Sum (C) 130 50 20 200 36
  • 37. Chi-square test of independence O E (O – E)2 (O – E) (O – E)2 / E F / Quinn 40   39   1   1   F / Lhota 10   15   -­‐5   25   F / Other 10   6   4   16   M / Quinn 90   91   1   1   M / Lhota 40   35   5   25   M / Other 10 14 -4 16 200 200 0 84 Sum 0.03 1.67 2.67 0.01 0.71 1.14 6.23 37
  • 38. Chi-square test of independence χ2 = Σ [(O - E)2 / E] χ2 = 6.23, df = 2 p = .04 ∴ Reject the null hypothesis and conclude that the there is a significant relationship between gender of 38 the defendant and verdict
  • 39. Chi-square test of independence To estimate effect size Cramér’s V (or Phi) Φc = SQRT(χ2 / N(k – 1)) Φc = SQRT(6.23 / 200(2 – 1)) = .18 39
  • 40. Dataframe in R (Election) Voter.ID   Candidate   Gender   1   Quinn   M   2   Quinn   F   3   Other   F   4   Lhota   M   5   Other   M   ….   …   …   40
  • 41. Chi-square test in R > Observed = table(Election$Candidate, Election$Gender) > chisq.test(Observed) 41
  • 43. Assumptions •  Adequate expected cell counts –  A common rule is 5 or more in all cells of a 2by-2 table, and 5 or more in 80% of cells in larger tables, and no cells with zero. –  When this assumption is not met, Fisher’s exact test, a non-parametric test, is recommended. 43
  • 44. Assumptions •  Independence –  The observations are assumed to be independent of each other. –  This means chi-squared cannot be used to test correlated data (like matched pairs or panel data). –  In such cases McNemar’s test of dependent proportions is recommended. 44
  • 45. Segment summary •  Chi-square tests are used when outcome and predictor variables are all categorical •  Chi-square test of independence is an NHST •  Cramér’s V estimates effect size •  Assumptions –  Adequate expected cell counts –  Independence 45