SlideShare a Scribd company logo
1 of 50
Chapter 12 The Analysis of Categorical Data and Goodness-of-Fit Tests
Univariate Categorical Data ,[object Object]
Univariate Categorical Data ,[object Object],[object Object],[object Object]
Notation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Hypotheses  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Expected Counts  ,[object Object]
Expected Counts - Example ,[object Object]
Goodness-of-fit statistic,   2 The value of the    2  statistic is the sum of these terms. The  goodness-of-fit statistic,   2 , results from first computing the quantity for each cell.
Chi-square distributions
Upper-tail Areas for Chi-square Distributions
Goodness-of-Fit Test Procedure Hypotheses: H 0 :  1  = hypothesized proportion for category 1  2  = hypothesized proportion for category 2        k  = hypothesized proportion for category k H a : H 0  is not true Test statistic:
Goodness-of-Fit Test Procedure P-values:  When H 0  is true and   all expected counts are at least 5,   2  has approximately a chi-square distribution with df = k-1.  Therefore, the P-value associated with the computed test statistic value is the area to the right of   2  under the df = k-1 chi-square curve.
Goodness-of-Fit Test Procedure ,[object Object],[object Object],[object Object]
Example Consider the newsperson’s desire to determine if the faculty of a large university system were equally distributed. Let us test this hypothesis at a significance level of 0.05. Let   1 ,   2 ,   3 ,   4 , and   5  denote the proportions of all faculty in this university system that are full professors, associate professors, assistant professors, instructors and adjunct/part time respectively. H 0 :   1  = 0.2,   2  = 0.2,   3  = 0.2,   4 = 0.2,   5  = 0.2 H a : H 0  is not true
Example Significance level :    = 0.05 Assumptions :  As we saw in an earlier slide, the expected counts were all 30.8 which is greater than 5. Although we do not know for sure how the sample was obtained for the purposes of this example, we shall assume selection procedure generated a random sample. Test statistic:
Example Calculation: recall
Example P-value :  The P-value is based on a chi-squared distribution with df = 5 - 1 = 4. The computed value of   2 , 7.56 is smaller than 7.77, the lowest value of   2  in the table for df = 4, so that the P-value is greater than 0.100. Conclusion :  Since the P-value > 0.05 =   , H 0  cannot be rejected. There is insufficient evidence to refute the claim that the proportion of faculty in each of the different categories is the same.
Tests for Homogeneity and Independence in a Two-Way Table Data resulting from observations made on two different categorical variables can be summarized using a tabular format. For example, consider the student data set giving information on 79 student dataset that was obtained from a sample of 79 students taking elementary statistics. The table is on the next slide.
Tests for Homogeneity and Independence in a Two-Way Table This is an example of a  two-way frequency table , or  contingency table .  The numbers in the 6 cells with clear backgrounds are the observed cell counts.
Tests for Homogeneity and Independence in a Two-Way Table Marginal totals  are obtained by adding the observed cell counts in each row and also in each column. The sum of the column marginal total (or the row marginal totals) is called the  grand total .
Tests for Homogeneity in a Two-Way Table Typically, with a two-way table used to test homogeneity, the rows indicate different populations and the columns indicate different categories or vice versa.  For a test of homogeneity, the central question is whether the category proportions are the same for all of the populations
Tests for Homogeneity in a Two-Way Table When the row indicates the population, the expected count for a cell is simply the overall proportion (over all populations) that have the category times the number in the population.  To illustrate: 54 = total number of male students = overall proportion of students using contacts = expected number of males that use contacts as primary vision correction
Tests for Homogeneity in a Two-Way Table The expected values for each cell represent what would be expected if there is no difference between the groups under study can be found easily by using the following formula.
Tests for Homogeneity in a Two-Way Table
Tests for Homogeneity in a Two-Way Table Expected counts are in parentheses.
Comparing Two or More Populations Using the   2  Statistic Hypotheses: H 0 : The true category proportions are the same for all of the populations (homogeneity of populations). H a : The true category proportions are not all the same for all of the populations.
Comparing Two or More Populations Using the   2  Statistic The expected cell counts are estimated from the sample data (assuming that H 0  is true) using the formula Test statistic:
Comparing Two or More Populations Using the   2  Statistic P-value: When H 0  is true,   2  has approximately a chi-square distribution with  The P-value associated with the computed test statistic value is the area to the right of   2  under the chi-square curve with the appropriate df. df = (number of rows - 1)(number of columns - 1)
Comparing Two or More Populations Using the   2  Statistic ,[object Object],[object Object],[object Object]
Example The following data come from a clinical trial of a drug regime used in treating a type of cancer, lymphocytic lymphomas.* Patients (273) were randomly divided into two groups, with one group of patients receiving cytoxan plus prednisone (CP) and the other receiving BCNU plus prednisone (BP). The responses to treatment were graded on a qualitative scale. The two-way table summary of the results is on the following slide. * Ezdinli, E., S., Berard, C. W.,  et al . (1976) Comparison of intensive   versus moderate chemotherapy of lympocytic lymphomas: a progress report.   Cancer ,  38 , 1060-1068.
Example Set up and perform an appropriate hypothesis test at the 0.05 level of significance.
Example Hypotheses: H 0 : The true response to treatment proportions are the same for both treatments (homogeneity of populations). H a : The true response to treatment proportions are not all the same for both treatments. Significance level :     = 0.05 Test statistic:
Example Assumptions : All expected cell counts are at least 5, and samples were chosen independently so the   2  test is appropriate.
Example Calculations : The two-way table for this example has 2 rows and 4 columns, so the appropriate df is (2-1)(4-1) =  3. Since 4.60 < 6.25, the P-value > 0.10 >    = 0.05 so H 0  is not rejected. There is insufficient evidence to conclude that the responses are different for the two treatments.
Comparing Two or More Populations Using the   2  Statistic P-value: When H 0  is true,    2   has approximately a chi-square distribution with  df = (number of rows - 1)(number of columns - 1) The P-value associated with the computed test statistic value is the area to the right of   2  under the chi-square curve with the appropriate df.
Example A student decided to study the shoppers in Wegman’s, a local supermarket to see if males and females exhibited the same behavior patterns with regard to the device use to carry items.  He observed 57 shoppers (presumably randomly) and obtained the results that are summarized in the table on the next slide.
Example ,[object Object]
Example Hypotheses: H 0 : The true proportions of the device used are the same for both genders. H a : The true proportions of the device used are the same for both genders. Significance level :     = 0.05 Test statistic:
Example Using Minitab, we get the following output: Chi-Square Test: Basket, Cart, Nothing Expected counts are printed below observed counts Basket  Cart  Nothing  Total 1  9  21  5  35 9.82  17.19  7.98 2  7  7  8  22 6.18  10.81  5.02 Total  16  28  13  57 Chi-Sq =  0.069 +  0.843 +  1.114 + 0.110 +  1.341 +  1.773 = 5.251 DF = 2, P-Value = 0.072
Example We draw the following conclusion. With a P-value of 0.072, there is insufficient evidence at the 0.05 significance level to support a claim that males and females are not the same in terms of proportionate use of carrying devices at Wegman’s supermarket.
 2  Test for Independence Hypotheses: H 0 : The two variables are independent. H a : The two variables are not independent. The   2  test statistic and procedures can also be used to investigate the association between tow categorical variable in a single population.
 2  Test for Independence The expected cell counts are estimated from the sample data (assuming that H 0  is true) using the formula Test statistic:
 2  Test for Independence The P-value associated with the computed test statistic value is the area to the right of   2  under the chi-square curve with the appropriate df. P-value: When H 0  is true,   2  has approximately a chi-square distribution with  df = (number of rows - 1)(number of columns - 1)
 2  Test for Independence ,[object Object],[object Object],[object Object]
Example Consider the two categorical variables, gender and principle form of vision correction for the sample of students used earlier in this presentation. We shall now test to see if the gender and the principle form of vision correction are independent.
Example Hypotheses: H 0 : Gender and principle method of vision correction are independent. H a :  Gender and principle method of vision correction are not independent. Significance level :  We have not chosen one, so we shall look at the practical significance level. Test statistic:
Example Assumptions : We are assuming that the sample of students was randomly chosen. All expected cell counts are at least 5, and samples were chosen independently so the   2  test is appropriate.
Example Assumptions : Notice that the expected count is less than 5 in the cell corresponding to Female and Contacts. So that we should combine the columns for Contacts and Glasses to get
Example The contingency table for this example has 2 rows and 2 columns, so the appropriate df is (2-1)(2-1) =  1. Since 0.246 < 2.70, the P-value is substantially greater than 0.10. H 0  would not be rejected for any reasonable significance level. There is not sufficient evidence to conclude that the gender and vision correction are related.  (I.e., For all practical purposes, one would find it reasonable to assume that gender and need for vision correction are independent.  Calculations :
Example Minitab would provide the following output if the frequency table was input as shown. Chi-Square Test: Contacts or Glasses, None Expected counts are printed below observed counts Contacts  None  Total 1  14  11  25 12.97  12.03 2  27  27  54 28.03  25.97 Total  41  38  79 Chi-Sq =  0.081 +  0.087 + 0.038 +  0.040 = 0.246 DF = 1, P-Value = 0.620

More Related Content

What's hot (20)

ANOVA-One Way Classification
ANOVA-One Way ClassificationANOVA-One Way Classification
ANOVA-One Way Classification
 
The chi square test of indep of categorical variables
The chi square test of indep of categorical variablesThe chi square test of indep of categorical variables
The chi square test of indep of categorical variables
 
Chi Square Worked Example
Chi Square Worked ExampleChi Square Worked Example
Chi Square Worked Example
 
Goodness of Fit Notation
Goodness of Fit NotationGoodness of Fit Notation
Goodness of Fit Notation
 
Chi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemarChi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemar
 
The chi – square test
The chi – square testThe chi – square test
The chi – square test
 
What is chi square test
What  is  chi square testWhat  is  chi square test
What is chi square test
 
Degrees Of Freedom Assignment No 3
Degrees Of Freedom Assignment No 3Degrees Of Freedom Assignment No 3
Degrees Of Freedom Assignment No 3
 
Chi sqyre test
Chi sqyre testChi sqyre test
Chi sqyre test
 
One way anova
One way anovaOne way anova
One way anova
 
Small Sampling Theory Presentation1
Small Sampling Theory Presentation1Small Sampling Theory Presentation1
Small Sampling Theory Presentation1
 
The Kruskal-Wallis H Test
The Kruskal-Wallis H TestThe Kruskal-Wallis H Test
The Kruskal-Wallis H Test
 
Chi square mahmoud
Chi square mahmoudChi square mahmoud
Chi square mahmoud
 
Practice Test 1
Practice Test 1Practice Test 1
Practice Test 1
 
Chi square[1]
Chi square[1]Chi square[1]
Chi square[1]
 
One-Way ANOVA
One-Way ANOVAOne-Way ANOVA
One-Way ANOVA
 
Aron chpt 11 ed (2)
Aron chpt 11 ed (2)Aron chpt 11 ed (2)
Aron chpt 11 ed (2)
 
Contingency Tables
Contingency TablesContingency Tables
Contingency Tables
 
Goodness Of Fit Test
Goodness Of Fit TestGoodness Of Fit Test
Goodness Of Fit Test
 
Chi-square distribution
Chi-square distribution Chi-square distribution
Chi-square distribution
 

Viewers also liked

Data-Driven Color Palettes for Categorical Maps
Data-Driven Color Palettes for Categorical MapsData-Driven Color Palettes for Categorical Maps
Data-Driven Color Palettes for Categorical Mapsnacis_slides
 
Chi square test for homgeneity
Chi square test for homgeneityChi square test for homgeneity
Chi square test for homgeneityamylute
 
Exporing categorical data formatted
Exporing categorical data formattedExporing categorical data formatted
Exporing categorical data formattedUlster BOCES
 
Demographic research
Demographic researchDemographic research
Demographic researchDariusslide
 
Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)
Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)
Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)pops macalino
 
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 testAldrin Lozano
 
Categorical Data Analysis in Python
Categorical Data Analysis in PythonCategorical Data Analysis in Python
Categorical Data Analysis in PythonJaidev Deshpande
 

Viewers also liked (13)

Data-Driven Color Palettes for Categorical Maps
Data-Driven Color Palettes for Categorical MapsData-Driven Color Palettes for Categorical Maps
Data-Driven Color Palettes for Categorical Maps
 
Quality driven management
Quality driven managementQuality driven management
Quality driven management
 
chi square test ( homo)
chi square test ( homo)chi square test ( homo)
chi square test ( homo)
 
Chi square test for homgeneity
Chi square test for homgeneityChi square test for homgeneity
Chi square test for homgeneity
 
Exporing categorical data formatted
Exporing categorical data formattedExporing categorical data formatted
Exporing categorical data formatted
 
Demographic research
Demographic researchDemographic research
Demographic research
 
Categorical Data
Categorical DataCategorical Data
Categorical Data
 
Chi square Test
Chi square TestChi square Test
Chi square Test
 
Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)
Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)
Chi-Square test of Homogeneity by Pops P. Macalino (TSU-MAEd)
 
Chi square
Chi squareChi square
Chi square
 
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
 
Categorical Data Analysis in Python
Categorical Data Analysis in PythonCategorical Data Analysis in Python
Categorical Data Analysis in Python
 
Chi squared test
Chi squared testChi squared test
Chi squared test
 

Similar to Chapter12

Parametric & non parametric
Parametric & non parametricParametric & non parametric
Parametric & non parametricANCYBS
 
QNT 275 Exceptional Education - snaptutorial.com
QNT 275   Exceptional Education - snaptutorial.comQNT 275   Exceptional Education - snaptutorial.com
QNT 275 Exceptional Education - snaptutorial.comDavisMurphyB22
 
Qnt 275 Enhance teaching / snaptutorial.com
Qnt 275 Enhance teaching / snaptutorial.comQnt 275 Enhance teaching / snaptutorial.com
Qnt 275 Enhance teaching / snaptutorial.comBaileya33
 
QNT 275 Inspiring Innovation / tutorialrank.com
QNT 275 Inspiring Innovation / tutorialrank.comQNT 275 Inspiring Innovation / tutorialrank.com
QNT 275 Inspiring Innovation / tutorialrank.comBromleyz33
 
Chi square and t tests, Neelam zafar & group
Chi square and t tests, Neelam zafar & groupChi square and t tests, Neelam zafar & group
Chi square and t tests, Neelam zafar & groupNeelam Zafar
 
Week 5 Lecture 14 The Chi Square TestQuite often, patterns of .docx
Week 5 Lecture 14 The Chi Square TestQuite often, patterns of .docxWeek 5 Lecture 14 The Chi Square TestQuite often, patterns of .docx
Week 5 Lecture 14 The Chi Square TestQuite often, patterns of .docxcockekeshia
 
Overview of Advance Marketing Research
Overview of Advance Marketing ResearchOverview of Advance Marketing Research
Overview of Advance Marketing ResearchEnamul Islam
 
Week 5 Lecture 14 The Chi Square Test Quite often, pat.docx
Week 5 Lecture 14 The Chi Square Test Quite often, pat.docxWeek 5 Lecture 14 The Chi Square Test Quite often, pat.docx
Week 5 Lecture 14 The Chi Square Test Quite often, pat.docxcockekeshia
 
Chi square test social research refer.ppt
Chi square test social research refer.pptChi square test social research refer.ppt
Chi square test social research refer.pptSnehamurali18
 
Qnt 275 final exam july 2017 version
Qnt 275 final exam july 2017 versionQnt 275 final exam july 2017 version
Qnt 275 final exam july 2017 versionAdams-ASs
 
Statistical Significance Tests.pptx
Statistical Significance Tests.pptxStatistical Significance Tests.pptx
Statistical Significance Tests.pptxAldofChrist
 
inferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdfinferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdfChenPalaruan
 
Statistics practice for finalBe sure to review the following.docx
Statistics practice for finalBe sure to review the following.docxStatistics practice for finalBe sure to review the following.docx
Statistics practice for finalBe sure to review the following.docxdessiechisomjj4
 
Testing of Hypothesis, p-value, Gaussian distribution, null hypothesis
Testing of Hypothesis, p-value, Gaussian distribution, null hypothesisTesting of Hypothesis, p-value, Gaussian distribution, null hypothesis
Testing of Hypothesis, p-value, Gaussian distribution, null hypothesissvmmcradonco1
 

Similar to Chapter12 (20)

Parametric & non parametric
Parametric & non parametricParametric & non parametric
Parametric & non parametric
 
QNT 275 Exceptional Education - snaptutorial.com
QNT 275   Exceptional Education - snaptutorial.comQNT 275   Exceptional Education - snaptutorial.com
QNT 275 Exceptional Education - snaptutorial.com
 
Qnt 275 Enhance teaching / snaptutorial.com
Qnt 275 Enhance teaching / snaptutorial.comQnt 275 Enhance teaching / snaptutorial.com
Qnt 275 Enhance teaching / snaptutorial.com
 
Chi-square test.pptx
Chi-square test.pptxChi-square test.pptx
Chi-square test.pptx
 
QNT 275 Inspiring Innovation / tutorialrank.com
QNT 275 Inspiring Innovation / tutorialrank.comQNT 275 Inspiring Innovation / tutorialrank.com
QNT 275 Inspiring Innovation / tutorialrank.com
 
Chi square and t tests, Neelam zafar & group
Chi square and t tests, Neelam zafar & groupChi square and t tests, Neelam zafar & group
Chi square and t tests, Neelam zafar & group
 
Week 5 Lecture 14 The Chi Square TestQuite often, patterns of .docx
Week 5 Lecture 14 The Chi Square TestQuite often, patterns of .docxWeek 5 Lecture 14 The Chi Square TestQuite often, patterns of .docx
Week 5 Lecture 14 The Chi Square TestQuite often, patterns of .docx
 
Overview of Advance Marketing Research
Overview of Advance Marketing ResearchOverview of Advance Marketing Research
Overview of Advance Marketing Research
 
Week 5 Lecture 14 The Chi Square Test Quite often, pat.docx
Week 5 Lecture 14 The Chi Square Test Quite often, pat.docxWeek 5 Lecture 14 The Chi Square Test Quite often, pat.docx
Week 5 Lecture 14 The Chi Square Test Quite often, pat.docx
 
Chi square test social research refer.ppt
Chi square test social research refer.pptChi square test social research refer.ppt
Chi square test social research refer.ppt
 
Qnt 275 final exam july 2017 version
Qnt 275 final exam july 2017 versionQnt 275 final exam july 2017 version
Qnt 275 final exam july 2017 version
 
Chi square test
Chi square testChi square test
Chi square test
 
Statistical Significance Tests.pptx
Statistical Significance Tests.pptxStatistical Significance Tests.pptx
Statistical Significance Tests.pptx
 
inferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdfinferentialstatistics-210411214248.pdf
inferentialstatistics-210411214248.pdf
 
Inferential statistics
Inferential statisticsInferential statistics
Inferential statistics
 
Day 3 SPSS
Day 3 SPSSDay 3 SPSS
Day 3 SPSS
 
Statistics practice for finalBe sure to review the following.docx
Statistics practice for finalBe sure to review the following.docxStatistics practice for finalBe sure to review the following.docx
Statistics practice for finalBe sure to review the following.docx
 
TEST OF SIGNIFICANCE.pptx
TEST OF SIGNIFICANCE.pptxTEST OF SIGNIFICANCE.pptx
TEST OF SIGNIFICANCE.pptx
 
Chi square
Chi square Chi square
Chi square
 
Testing of Hypothesis, p-value, Gaussian distribution, null hypothesis
Testing of Hypothesis, p-value, Gaussian distribution, null hypothesisTesting of Hypothesis, p-value, Gaussian distribution, null hypothesis
Testing of Hypothesis, p-value, Gaussian distribution, null hypothesis
 

More from rwmiller

More from rwmiller (15)

Chapter06
Chapter06Chapter06
Chapter06
 
Chapter13
Chapter13Chapter13
Chapter13
 
Chapter10
Chapter10Chapter10
Chapter10
 
Chapter09
Chapter09Chapter09
Chapter09
 
Chapter08
Chapter08Chapter08
Chapter08
 
Chapter07
Chapter07Chapter07
Chapter07
 
Chapter05
Chapter05Chapter05
Chapter05
 
Chapter04
Chapter04Chapter04
Chapter04
 
Chapter03
Chapter03Chapter03
Chapter03
 
Chapter02
Chapter02Chapter02
Chapter02
 
Chapter01
Chapter01Chapter01
Chapter01
 
Chapter04
Chapter04Chapter04
Chapter04
 
Chapter03
Chapter03Chapter03
Chapter03
 
Chapter02
Chapter02Chapter02
Chapter02
 
Chapter01
Chapter01Chapter01
Chapter01
 

Recently uploaded

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

Chapter12

  • 1. Chapter 12 The Analysis of Categorical Data and Goodness-of-Fit Tests
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. Goodness-of-fit statistic,  2 The value of the  2 statistic is the sum of these terms. The goodness-of-fit statistic,  2 , results from first computing the quantity for each cell.
  • 10. Upper-tail Areas for Chi-square Distributions
  • 11. Goodness-of-Fit Test Procedure Hypotheses: H 0 :  1 = hypothesized proportion for category 1  2 = hypothesized proportion for category 2    k = hypothesized proportion for category k H a : H 0 is not true Test statistic:
  • 12. Goodness-of-Fit Test Procedure P-values: When H 0 is true and all expected counts are at least 5,  2 has approximately a chi-square distribution with df = k-1. Therefore, the P-value associated with the computed test statistic value is the area to the right of  2 under the df = k-1 chi-square curve.
  • 13.
  • 14. Example Consider the newsperson’s desire to determine if the faculty of a large university system were equally distributed. Let us test this hypothesis at a significance level of 0.05. Let  1 ,  2 ,  3 ,  4 , and  5 denote the proportions of all faculty in this university system that are full professors, associate professors, assistant professors, instructors and adjunct/part time respectively. H 0 :  1 = 0.2,  2 = 0.2,  3 = 0.2,  4 = 0.2,  5 = 0.2 H a : H 0 is not true
  • 15. Example Significance level :  = 0.05 Assumptions : As we saw in an earlier slide, the expected counts were all 30.8 which is greater than 5. Although we do not know for sure how the sample was obtained for the purposes of this example, we shall assume selection procedure generated a random sample. Test statistic:
  • 17. Example P-value : The P-value is based on a chi-squared distribution with df = 5 - 1 = 4. The computed value of  2 , 7.56 is smaller than 7.77, the lowest value of  2 in the table for df = 4, so that the P-value is greater than 0.100. Conclusion : Since the P-value > 0.05 =  , H 0 cannot be rejected. There is insufficient evidence to refute the claim that the proportion of faculty in each of the different categories is the same.
  • 18. Tests for Homogeneity and Independence in a Two-Way Table Data resulting from observations made on two different categorical variables can be summarized using a tabular format. For example, consider the student data set giving information on 79 student dataset that was obtained from a sample of 79 students taking elementary statistics. The table is on the next slide.
  • 19. Tests for Homogeneity and Independence in a Two-Way Table This is an example of a two-way frequency table , or contingency table . The numbers in the 6 cells with clear backgrounds are the observed cell counts.
  • 20. Tests for Homogeneity and Independence in a Two-Way Table Marginal totals are obtained by adding the observed cell counts in each row and also in each column. The sum of the column marginal total (or the row marginal totals) is called the grand total .
  • 21. Tests for Homogeneity in a Two-Way Table Typically, with a two-way table used to test homogeneity, the rows indicate different populations and the columns indicate different categories or vice versa. For a test of homogeneity, the central question is whether the category proportions are the same for all of the populations
  • 22. Tests for Homogeneity in a Two-Way Table When the row indicates the population, the expected count for a cell is simply the overall proportion (over all populations) that have the category times the number in the population. To illustrate: 54 = total number of male students = overall proportion of students using contacts = expected number of males that use contacts as primary vision correction
  • 23. Tests for Homogeneity in a Two-Way Table The expected values for each cell represent what would be expected if there is no difference between the groups under study can be found easily by using the following formula.
  • 24. Tests for Homogeneity in a Two-Way Table
  • 25. Tests for Homogeneity in a Two-Way Table Expected counts are in parentheses.
  • 26. Comparing Two or More Populations Using the  2 Statistic Hypotheses: H 0 : The true category proportions are the same for all of the populations (homogeneity of populations). H a : The true category proportions are not all the same for all of the populations.
  • 27. Comparing Two or More Populations Using the  2 Statistic The expected cell counts are estimated from the sample data (assuming that H 0 is true) using the formula Test statistic:
  • 28. Comparing Two or More Populations Using the  2 Statistic P-value: When H 0 is true,  2 has approximately a chi-square distribution with The P-value associated with the computed test statistic value is the area to the right of  2 under the chi-square curve with the appropriate df. df = (number of rows - 1)(number of columns - 1)
  • 29.
  • 30. Example The following data come from a clinical trial of a drug regime used in treating a type of cancer, lymphocytic lymphomas.* Patients (273) were randomly divided into two groups, with one group of patients receiving cytoxan plus prednisone (CP) and the other receiving BCNU plus prednisone (BP). The responses to treatment were graded on a qualitative scale. The two-way table summary of the results is on the following slide. * Ezdinli, E., S., Berard, C. W., et al . (1976) Comparison of intensive versus moderate chemotherapy of lympocytic lymphomas: a progress report. Cancer , 38 , 1060-1068.
  • 31. Example Set up and perform an appropriate hypothesis test at the 0.05 level of significance.
  • 32. Example Hypotheses: H 0 : The true response to treatment proportions are the same for both treatments (homogeneity of populations). H a : The true response to treatment proportions are not all the same for both treatments. Significance level :  = 0.05 Test statistic:
  • 33. Example Assumptions : All expected cell counts are at least 5, and samples were chosen independently so the  2 test is appropriate.
  • 34. Example Calculations : The two-way table for this example has 2 rows and 4 columns, so the appropriate df is (2-1)(4-1) = 3. Since 4.60 < 6.25, the P-value > 0.10 >  = 0.05 so H 0 is not rejected. There is insufficient evidence to conclude that the responses are different for the two treatments.
  • 35. Comparing Two or More Populations Using the  2 Statistic P-value: When H 0 is true,  2 has approximately a chi-square distribution with df = (number of rows - 1)(number of columns - 1) The P-value associated with the computed test statistic value is the area to the right of  2 under the chi-square curve with the appropriate df.
  • 36. Example A student decided to study the shoppers in Wegman’s, a local supermarket to see if males and females exhibited the same behavior patterns with regard to the device use to carry items. He observed 57 shoppers (presumably randomly) and obtained the results that are summarized in the table on the next slide.
  • 37.
  • 38. Example Hypotheses: H 0 : The true proportions of the device used are the same for both genders. H a : The true proportions of the device used are the same for both genders. Significance level :  = 0.05 Test statistic:
  • 39. Example Using Minitab, we get the following output: Chi-Square Test: Basket, Cart, Nothing Expected counts are printed below observed counts Basket Cart Nothing Total 1 9 21 5 35 9.82 17.19 7.98 2 7 7 8 22 6.18 10.81 5.02 Total 16 28 13 57 Chi-Sq = 0.069 + 0.843 + 1.114 + 0.110 + 1.341 + 1.773 = 5.251 DF = 2, P-Value = 0.072
  • 40. Example We draw the following conclusion. With a P-value of 0.072, there is insufficient evidence at the 0.05 significance level to support a claim that males and females are not the same in terms of proportionate use of carrying devices at Wegman’s supermarket.
  • 41.  2 Test for Independence Hypotheses: H 0 : The two variables are independent. H a : The two variables are not independent. The  2 test statistic and procedures can also be used to investigate the association between tow categorical variable in a single population.
  • 42.  2 Test for Independence The expected cell counts are estimated from the sample data (assuming that H 0 is true) using the formula Test statistic:
  • 43.  2 Test for Independence The P-value associated with the computed test statistic value is the area to the right of  2 under the chi-square curve with the appropriate df. P-value: When H 0 is true,  2 has approximately a chi-square distribution with df = (number of rows - 1)(number of columns - 1)
  • 44.
  • 45. Example Consider the two categorical variables, gender and principle form of vision correction for the sample of students used earlier in this presentation. We shall now test to see if the gender and the principle form of vision correction are independent.
  • 46. Example Hypotheses: H 0 : Gender and principle method of vision correction are independent. H a : Gender and principle method of vision correction are not independent. Significance level : We have not chosen one, so we shall look at the practical significance level. Test statistic:
  • 47. Example Assumptions : We are assuming that the sample of students was randomly chosen. All expected cell counts are at least 5, and samples were chosen independently so the  2 test is appropriate.
  • 48. Example Assumptions : Notice that the expected count is less than 5 in the cell corresponding to Female and Contacts. So that we should combine the columns for Contacts and Glasses to get
  • 49. Example The contingency table for this example has 2 rows and 2 columns, so the appropriate df is (2-1)(2-1) = 1. Since 0.246 < 2.70, the P-value is substantially greater than 0.10. H 0 would not be rejected for any reasonable significance level. There is not sufficient evidence to conclude that the gender and vision correction are related. (I.e., For all practical purposes, one would find it reasonable to assume that gender and need for vision correction are independent. Calculations :
  • 50. Example Minitab would provide the following output if the frequency table was input as shown. Chi-Square Test: Contacts or Glasses, None Expected counts are printed below observed counts Contacts None Total 1 14 11 25 12.97 12.03 2 27 27 54 28.03 25.97 Total 41 38 79 Chi-Sq = 0.081 + 0.087 + 0.038 + 0.040 = 0.246 DF = 1, P-Value = 0.620