SlideShare a Scribd company logo
1 of 9
Download to read offline
Chi-Square test
Prof. (Dr) Shahla Yasmin
Dept of Zoology
Patna Women’s College
χ2 test definition
• χ2 test is commonly used for testing relationships between categorical
(nominal or non-numerical) data such as Gender {Men, Women} or
color {Red, Yellow, Green, Blue} etc, but not numerical data such as
height or weight.
• It compares the counts of categorical responses between two (or more)
independent groups. (note: Chi square tests can only be used on actual
numbers and not on percentages, proportions, means, etc.)
• The null hypothesis (H0) of the Chi-Square test is that no relationship
exists on the categorical (nominal or non-numerical) variables in the
population.
• The technique involves working out the frequency that would be
expected if the null hypothesis were true.
• The expected frequency is then compared to the observed frequency
χ2 test
Formula is :
1. For each observed (o) number in the table subtract the
corresponding expected (E) number (O — E).
2. Square the difference [ (O —E)2 ].
3. Divide the squares obtained for each cell in the table by
the expected number for that cell [ (O - E)2 / E ].
4. Sum all the values for (O - E)2 / E. This is the chi square statistic.
5. Evaluate the degrees of freedom (number of categories minus one)
6. Tally the χ2 value with the tabulated value (present at the end of
books) at the evaluated degrees of freedom
Example-data in one row
• Three traps have been designed to trap birds (A,B,C)
• Number of birds trapped (observed frequencies) by each
design are compared
• First step is to formulate a null hypothesis (Ho) =there is no
association between number of birds trapped and trap design
• If there is no association between number of birds trapped
and trap design, all the three types of traps will capture equal
number of birds
Example-contd.
Design A Design B Design C
Observed
frequencies
10 27 15
Expected
frequencies
17.33 =
(10+27+15)/3
17.33 17.33
(10-17.33)2/17.33
=3.10
(27-17.33)2/17.33
=5.40
(15-17.33)2/17.33
=0.313
=3.10+5.40+0.313 =8.813
•The degrees of freedom in this case is 3-1=2
•The χ2 value of 8.813 at 2 degrees of freedom is greater than the
tabulated value 5.99 at 0.05 level of significance (see next slide)
•It is concluded that there is association between trap design and
number of birds trapped
•Thus null hypothesis (H0) is rejected.
Df 0.5 0.10 0.05 0.02 0.01 0.001
1 0.455 2.706 3.841 5.412 6.635 10.827
2 1.386 4.605 5.991 7.824 9.210 13.815
3 2.366 6.251 7.815 9.837 11.345 16.268
4 3.357 7.779 9.488 11.668 13.277 18.465
5 4.351 9.236 11.070 13.388 15.086 20.517
Chi Square distribution table. probability level (alpha)
Example-data in two rows
• Suppose a drug trial was conducted on a group of animals and
it washypothesized that the animals receiving the drug would
show increased heart rates compared to those that did not
receive the drug.
• Ho (null hypothesis): The proportion of animals whose heart
rate increased is independent of drug treatment.
Heart Rate
Increased
No increase in heart
rate
total
Treated Observed=36
Expected =66X50/105
= 31.42
χ2=(36-31.42)2/31.42
= 0.66
Observed =14
Expected =39X50/105
=18.57
χ2=(14-18.57) 2/18.57
= 1.12
50
Not-treated Observed=30
Expected =66X55/105
= 34.57
χ2=(30-34.57) 2/34.57
=0.60
Observed=25
Expected =39X55/105
= 20.42
Χ2=(25-20.42) 2/20.42
= 1.02
55
Total 66 39 105
•χ2= 0.66+1.12+0.60+1.02 = 3.4
•Degrees of freedom = (columns-1)(rows-1) = (2-1)(2-1) =1
•The χ2 value of 3.4 at 1 degrees of freedom is less than the tabulated value 3.84
at 0.05 level of significance
•Therefore, the null hypothesis cannot be rejected
Uses of Chi-square test
• (a) To test the hypothesis of no association between two or
more groups, population or criteria (i.e. to check
independence between two variables);
• (b) and to test how likely the observed distribution of data fits
with the distribution that is expected (i.e., to test the
goodness-of-fit).
• It is used to analyze categorical data (e.g. male or female
patients, smokers and non-smokers, etc.),
• it is not meant to analyze parametric or continuous data (e.g.,
height measured in centimeters or weight measured in kg,
etc.).

More Related Content

What's hot

What's hot (19)

Measure of Dispersion in statistics
Measure of Dispersion in statisticsMeasure of Dispersion in statistics
Measure of Dispersion in statistics
 
Measures of Central Tendency and Dispersion
Measures of Central Tendency and DispersionMeasures of Central Tendency and Dispersion
Measures of Central Tendency and Dispersion
 
Normal Distribution
Normal DistributionNormal Distribution
Normal Distribution
 
Measures of Dispersion - Thiyagu
Measures of Dispersion - ThiyaguMeasures of Dispersion - Thiyagu
Measures of Dispersion - Thiyagu
 
Standard deviation by nikita
Standard deviation by nikitaStandard deviation by nikita
Standard deviation by nikita
 
Measures of dispersion
Measures  of  dispersionMeasures  of  dispersion
Measures of dispersion
 
Central tendency and Variation or Dispersion
Central tendency and Variation or DispersionCentral tendency and Variation or Dispersion
Central tendency and Variation or Dispersion
 
Measures of Central Tendency
Measures of Central TendencyMeasures of Central Tendency
Measures of Central Tendency
 
Measures of dispersion
Measures of dispersionMeasures of dispersion
Measures of dispersion
 
Lecture slides stats1.13.l09.air
Lecture slides stats1.13.l09.airLecture slides stats1.13.l09.air
Lecture slides stats1.13.l09.air
 
Stat3 central tendency & dispersion
Stat3 central tendency & dispersionStat3 central tendency & dispersion
Stat3 central tendency & dispersion
 
Standard deviation
Standard deviationStandard deviation
Standard deviation
 
Chapter03
Chapter03Chapter03
Chapter03
 
Descriptive Statistics - Thiyagu K
Descriptive Statistics - Thiyagu KDescriptive Statistics - Thiyagu K
Descriptive Statistics - Thiyagu K
 
Chapter 7 : Inference for Distributions(The t Distributions, One-Sample t Con...
Chapter 7 : Inference for Distributions(The t Distributions, One-Sample t Con...Chapter 7 : Inference for Distributions(The t Distributions, One-Sample t Con...
Chapter 7 : Inference for Distributions(The t Distributions, One-Sample t Con...
 
T test statistic
T test statisticT test statistic
T test statistic
 
Measures of dispersions
Measures of dispersionsMeasures of dispersions
Measures of dispersions
 
Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)Test of significance (t-test, proportion test, chi-square test)
Test of significance (t-test, proportion test, chi-square test)
 
Standard deviation
Standard deviationStandard deviation
Standard deviation
 

Similar to Chi square test

CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptxCHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
rathorebhagwan07
 
Lecture-6 (t-test and one way ANOVA.ppt
Lecture-6 (t-test and one way ANOVA.pptLecture-6 (t-test and one way ANOVA.ppt
Lecture-6 (t-test and one way ANOVA.ppt
habtamu biazin
 

Similar to Chi square test (20)

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
 
Statistical analysis by iswar
Statistical analysis by iswarStatistical analysis by iswar
Statistical analysis by iswar
 
Chi square test
Chi square testChi square test
Chi square test
 
Tugasan kumpulan anova
Tugasan kumpulan anovaTugasan kumpulan anova
Tugasan kumpulan anova
 
Chi squared test
Chi squared testChi squared test
Chi squared test
 
Chapter12
Chapter12Chapter12
Chapter12
 
CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptxCHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
CHI SQUARE DISTRIBUTIONdjfnbefklwfwpfioaekf.pptx
 
Chi sqyre test
Chi sqyre testChi sqyre test
Chi sqyre test
 
Chi-Square test.pptx
Chi-Square test.pptxChi-Square test.pptx
Chi-Square test.pptx
 
Categorical data final
Categorical data finalCategorical data final
Categorical data final
 
Chi square tests
Chi square testsChi square tests
Chi square tests
 
Survival.pptx
Survival.pptxSurvival.pptx
Survival.pptx
 
Lect w7 t_test_amp_chi_test
Lect w7 t_test_amp_chi_testLect w7 t_test_amp_chi_test
Lect w7 t_test_amp_chi_test
 
Lecture-6 (t-test and one way ANOVA.ppt
Lecture-6 (t-test and one way ANOVA.pptLecture-6 (t-test and one way ANOVA.ppt
Lecture-6 (t-test and one way ANOVA.ppt
 
Contingency Table Test, M. Asad Hayat, UET Taxila
Contingency Table Test, M. Asad Hayat, UET TaxilaContingency Table Test, M. Asad Hayat, UET Taxila
Contingency Table Test, M. Asad Hayat, UET Taxila
 
95720357 a-design-of-experiments
95720357 a-design-of-experiments95720357 a-design-of-experiments
95720357 a-design-of-experiments
 
Contingency Tables
Contingency TablesContingency Tables
Contingency Tables
 
Chi-square test.pptx
Chi-square test.pptxChi-square test.pptx
Chi-square test.pptx
 
Chi squared test
Chi squared testChi squared test
Chi squared test
 
Chi square2012
Chi square2012Chi square2012
Chi square2012
 

Recently uploaded

Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
PirithiRaju
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
Sérgio Sacani
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Sérgio Sacani
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
PirithiRaju
 

Recently uploaded (20)

Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit flypumpkin fruit fly, water melon fruit fly, cucumber fruit fly
pumpkin fruit fly, water melon fruit fly, cucumber fruit fly
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
Locating and isolating a gene, FISH, GISH, Chromosome walking and jumping, te...
 
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATIONSTS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
STS-UNIT 4 CLIMATE CHANGE POWERPOINT PRESENTATION
 
IDENTIFICATION OF THE LIVING- forensic medicine
IDENTIFICATION OF THE LIVING- forensic medicineIDENTIFICATION OF THE LIVING- forensic medicine
IDENTIFICATION OF THE LIVING- forensic medicine
 
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
Vip profile Call Girls In Lonavala 9748763073 For Genuine Sex Service At Just...
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Alandi Call Me 7737669865 Budget Friendly No Advance Booking
 

Chi square test

  • 1. Chi-Square test Prof. (Dr) Shahla Yasmin Dept of Zoology Patna Women’s College
  • 2. χ2 test definition • χ2 test is commonly used for testing relationships between categorical (nominal or non-numerical) data such as Gender {Men, Women} or color {Red, Yellow, Green, Blue} etc, but not numerical data such as height or weight. • It compares the counts of categorical responses between two (or more) independent groups. (note: Chi square tests can only be used on actual numbers and not on percentages, proportions, means, etc.) • The null hypothesis (H0) of the Chi-Square test is that no relationship exists on the categorical (nominal or non-numerical) variables in the population. • The technique involves working out the frequency that would be expected if the null hypothesis were true. • The expected frequency is then compared to the observed frequency
  • 3. χ2 test Formula is : 1. For each observed (o) number in the table subtract the corresponding expected (E) number (O — E). 2. Square the difference [ (O —E)2 ]. 3. Divide the squares obtained for each cell in the table by the expected number for that cell [ (O - E)2 / E ]. 4. Sum all the values for (O - E)2 / E. This is the chi square statistic. 5. Evaluate the degrees of freedom (number of categories minus one) 6. Tally the χ2 value with the tabulated value (present at the end of books) at the evaluated degrees of freedom
  • 4. Example-data in one row • Three traps have been designed to trap birds (A,B,C) • Number of birds trapped (observed frequencies) by each design are compared • First step is to formulate a null hypothesis (Ho) =there is no association between number of birds trapped and trap design • If there is no association between number of birds trapped and trap design, all the three types of traps will capture equal number of birds
  • 5. Example-contd. Design A Design B Design C Observed frequencies 10 27 15 Expected frequencies 17.33 = (10+27+15)/3 17.33 17.33 (10-17.33)2/17.33 =3.10 (27-17.33)2/17.33 =5.40 (15-17.33)2/17.33 =0.313 =3.10+5.40+0.313 =8.813 •The degrees of freedom in this case is 3-1=2 •The χ2 value of 8.813 at 2 degrees of freedom is greater than the tabulated value 5.99 at 0.05 level of significance (see next slide) •It is concluded that there is association between trap design and number of birds trapped •Thus null hypothesis (H0) is rejected.
  • 6. Df 0.5 0.10 0.05 0.02 0.01 0.001 1 0.455 2.706 3.841 5.412 6.635 10.827 2 1.386 4.605 5.991 7.824 9.210 13.815 3 2.366 6.251 7.815 9.837 11.345 16.268 4 3.357 7.779 9.488 11.668 13.277 18.465 5 4.351 9.236 11.070 13.388 15.086 20.517 Chi Square distribution table. probability level (alpha)
  • 7. Example-data in two rows • Suppose a drug trial was conducted on a group of animals and it washypothesized that the animals receiving the drug would show increased heart rates compared to those that did not receive the drug. • Ho (null hypothesis): The proportion of animals whose heart rate increased is independent of drug treatment.
  • 8. Heart Rate Increased No increase in heart rate total Treated Observed=36 Expected =66X50/105 = 31.42 χ2=(36-31.42)2/31.42 = 0.66 Observed =14 Expected =39X50/105 =18.57 χ2=(14-18.57) 2/18.57 = 1.12 50 Not-treated Observed=30 Expected =66X55/105 = 34.57 χ2=(30-34.57) 2/34.57 =0.60 Observed=25 Expected =39X55/105 = 20.42 Χ2=(25-20.42) 2/20.42 = 1.02 55 Total 66 39 105 •χ2= 0.66+1.12+0.60+1.02 = 3.4 •Degrees of freedom = (columns-1)(rows-1) = (2-1)(2-1) =1 •The χ2 value of 3.4 at 1 degrees of freedom is less than the tabulated value 3.84 at 0.05 level of significance •Therefore, the null hypothesis cannot be rejected
  • 9. Uses of Chi-square test • (a) To test the hypothesis of no association between two or more groups, population or criteria (i.e. to check independence between two variables); • (b) and to test how likely the observed distribution of data fits with the distribution that is expected (i.e., to test the goodness-of-fit). • It is used to analyze categorical data (e.g. male or female patients, smokers and non-smokers, etc.), • it is not meant to analyze parametric or continuous data (e.g., height measured in centimeters or weight measured in kg, etc.).