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

ANOVA-One Way Classification
ANOVA-One Way ClassificationANOVA-One Way Classification
ANOVA-One Way Classification
Sharlaine Ruth
 
Degrees Of Freedom Assignment No 3
Degrees Of Freedom Assignment No 3Degrees Of Freedom Assignment No 3
Degrees Of Freedom Assignment No 3
Abdul Zaman
 
Small Sampling Theory Presentation1
Small Sampling Theory Presentation1Small Sampling Theory Presentation1
Small Sampling Theory Presentation1
jravish
 
Chi square[1]
Chi square[1]Chi square[1]
Chi square[1]
sbarkanic
 
Aron chpt 11 ed (2)
Aron chpt 11 ed (2)Aron chpt 11 ed (2)
Aron chpt 11 ed (2)
Sandra Nicks
 

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

Exporing categorical data formatted
Exporing categorical data formattedExporing categorical data formatted
Exporing categorical data formatted
Ulster BOCES
 
Demographic research
Demographic researchDemographic research
Demographic research
Dariusslide
 
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
 

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

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
cockekeshia
 
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
cockekeshia
 
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
Snehamurali18
 
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
dessiechisomjj4
 
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
svmmcradonco1
 

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

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 

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