SlideShare uma empresa Scribd logo
1 de 16
Chi-Square
Goodness of
Fit Test
In general, the chi-square test
statistic is of the form

If the computed test statistic is
large, then the observed and
expected values are not close and
the model is a poor fit to the data.
2


…the distribution with n
- 1 degrees of freedom.
2. Problem
Solution
When to Use the Chi-Square Goodness of Fit
Test
The chi-square goodness of fit test is appropriate
when the following conditions are met:
•The sampling method is simple random sampling.
•The population is at least 10 times as large as the
sample.
•The variable under study is categorical.
•The expected value of the number of sample
observations in each level of the variable is at least 5.

This approach consists of four steps: (1)
state the hypotheses, (2) formulate an analysis
plan, (3) analyze sample data, and (4) interpret
State the Hypotheses
Every hypothesis test requires the analyst to state a null
hypothesis and an alternative hypothesis. The hypotheses are
stated in such a way that they are mutually exclusive. That is, if
one is true, the other must be false; and vice versa.
For a chi-square goodness of fit test, the hypotheses take the
following form. H : The data are consistent with a specified
0

distribution.
Ha: The data are not consistent with a
specified distribution.

Typically, the null hypothesis specifies the proportion of
observations at each level of the categorical variable.
The alternative hypothesis is that at least one of the
specified proportions is not true.
Formulate an Analysis Plan
The analysis plan describes how to use sample data to
accept or reject the null hypothesis. The plan should
specify the following elements.
•Significance level. Often, researchers choose
significance levels equal to 0.01, 0.05, or 0.10; but
any value between 0 and 1 can be used.

•Test method. Use the chi-square goodness of fit test
to determine whether observed sample frequencies
differ significantly from expected frequencies
specified in the null hypothesis. The chi-square
goodness of fit test is described in the next
section, and demonstrated in the sample problem at
the end of this lesson.
Analyze Sample Data
Using sample data, find the degrees of freedom, expected
frequency counts, test statistic, and the P-value associated with
the test statistic.
•Degrees of freedom. The degrees of freedom (DF) is equal to the number
of levels (k) of the categorical variable minus 1: DF = k - 1 .
•Expected frequency counts. The expected frequency counts at each level
of the categorical variable are equal to the sample size times the
hypothesized proportion from the null hypothesis
Ei = npi
where Ei is the expected frequency count for the ith level of the categorical
variable, n is the total sample size, and pi is the hypothesized proportion of
observations in level i.
•Test statistic. The test statistic is a chi-square random variable
(Χ2) defined by the following equation.
Χ2 = Σ [ (Oi - Ei)2 / Ei ]
where Oi is the observed frequency count for the ith level of the
categorical variable, and Ei is the expected frequency count for
the ith level of the categorical variable.
•P-value. The P-value is the probability of observing a sample
statistic as extreme as the test statistic. Use the degrees of
freedom computed.
Interpret Results
If the sample findings are unlikely, given the null
hypothesis, the researcher rejects the null
hypothesis. Typically, this involves comparing the
P-value to the significance level, and rejecting the
null hypothesis when the P-value is less than the
significance level.
Problem
Acme Toy Company prints baseball cards.
The company claims that 30% of the cards are
rookies, 60% veterans, and 10% are All-Stars.
The cards are sold in packages of 100.
Suppose a randomly-selected package of
cards has 50 rookies, 45 veterans, and 5 AllStars. Is this consistent with Acme's claim? Use a
0.05 level of significance.
Solution
The solution to this problem takes four steps: (1)
state the hypotheses, (2) formulate an analysis
plan, (3) analyze sample data, and (4) interpret
results. We work through those steps below:
1. State the hypotheses. The first step is to
state the null hypothesis and an alternative
hypothesis.
•Null hypothesis(H0): The proportion of
rookies, veterans, and All-Stars is 30%, 60%
and 10%, respectively.
•Alternative hypothesis(Ha): At least one of
the proportions in the null hypothesis is
2. Formulate an analysis plan. For this analysis, the significance level is 0.05. Using
sample data, we will conduct a chi-square goodness of fit test of the null hypothesis.
3. Analyze sample data. Applying the chi-square goodness of fit test to sample data, we
compute the degrees of freedom, the expected frequency counts, and the chi-square
test statistic. Based on the chi-square statistic and the degrees of freedom, we
determine the P-value.
DF = k - 1

3-1=2

(Ei) = n * pi
(E1) = 100 * 0.30 = 30
(E2) = 100 * 0.60 = 60
(E3) = 100 * 0.10 = 10
Χ2 = Σ [ (Oi - Ei)2 / Ei ]
Χ2 = [ (50 - 30)2 / 30 ] + [ (45 - 60)2 / 60 ] + [ (5 - 10)2 / 10 ]
Χ2 = (400 / 30) + (225 / 60) + (25 / 10) = 13.33 + 3.75 + 2.50 = 19.58

where DF is the degrees of freedom, k is the number of levels of the categorical
variable, n is the number of observations in the sample, Ei is the expected frequency
count for level i, Oi is the observed frequency count for level i, and Χ2 is the chi-square
test statistic.
The P-value is the probability that a chi-square statistic having 2 degrees of
freedom is more extreme than 19.58.
4. Interpret results. Since the P-value (0.0001) is less
than the significance level (0.05), we cannot accept the
null hypothesis.

Note: If you use this approach on an exam, you may
also want to mention why this approach is appropriate.
Specifically, the approach is appropriate because the
sampling method was simple random sampling, the
population was more than 10 times larger than the
sample, the variable under study was categorical, and
each level of the categorical variable had an expected
frequency count of at least 5.
A new casino game involves rolling 3 dice. The winnings are directly
proportional to the total number of sixes rolled. Suppose a gambler plays the
game 100 times, with the following observed counts:
Number of Sixes
Number of Rolls
0
48
1
35
2
15
3
3
The casino becomes suspicious of the gambler and wishes to determine
whether the dice are fair. What do they conclude?

Mais conteúdo relacionado

Mais procurados (20)

Goodness Of Fit Test
Goodness Of Fit TestGoodness Of Fit Test
Goodness Of Fit Test
 
Two sample t-test
Two sample t-testTwo sample t-test
Two sample t-test
 
Analysis of variance (ANOVA)
Analysis of variance (ANOVA)Analysis of variance (ANOVA)
Analysis of variance (ANOVA)
 
Randomized complete block_design_rcbd_
Randomized complete block_design_rcbd_Randomized complete block_design_rcbd_
Randomized complete block_design_rcbd_
 
Skewness and kurtosis
Skewness and kurtosisSkewness and kurtosis
Skewness and kurtosis
 
Sampling distribution
Sampling distributionSampling distribution
Sampling distribution
 
Chi-square distribution
Chi-square distribution Chi-square distribution
Chi-square distribution
 
Correlation and Regression
Correlation and RegressionCorrelation and Regression
Correlation and Regression
 
Spearman Rank Correlation Presentation
Spearman Rank Correlation PresentationSpearman Rank Correlation Presentation
Spearman Rank Correlation Presentation
 
The Normal distribution
The Normal distributionThe Normal distribution
The Normal distribution
 
Z test
Z testZ test
Z test
 
Errors and types
Errors and typesErrors and types
Errors and types
 
Correlation and Regression
Correlation and RegressionCorrelation and Regression
Correlation and Regression
 
Measures of central tendency and dispersion
Measures of central tendency and dispersionMeasures of central tendency and dispersion
Measures of central tendency and dispersion
 
Chi square test
Chi square testChi square test
Chi square test
 
Skewness and kurtosis ppt
Skewness and kurtosis pptSkewness and kurtosis ppt
Skewness and kurtosis ppt
 
Goodness of-fit
Goodness of-fit  Goodness of-fit
Goodness of-fit
 
The sampling distribution
The sampling distributionThe sampling distribution
The sampling distribution
 
Testing Hypothesis
Testing HypothesisTesting Hypothesis
Testing Hypothesis
 
In Anova
In  AnovaIn  Anova
In Anova
 

Semelhante a Goodness of fit (ppt) (20)

Test of-significance : Z test , Chi square test
Test of-significance : Z test , Chi square testTest of-significance : Z test , Chi square test
Test of-significance : Z test , Chi square test
 
Testing a claim about a standard deviation or variance
Testing a claim about a standard deviation or variance  Testing a claim about a standard deviation or variance
Testing a claim about a standard deviation or variance
 
Test of significance
Test of significanceTest of significance
Test of significance
 
Day 3 SPSS
Day 3 SPSSDay 3 SPSS
Day 3 SPSS
 
Hypothesis Testing
Hypothesis TestingHypothesis Testing
Hypothesis Testing
 
Sampling theory
Sampling theorySampling theory
Sampling theory
 
STATISTIC ESTIMATION
STATISTIC ESTIMATIONSTATISTIC ESTIMATION
STATISTIC ESTIMATION
 
Chi square
Chi square Chi square
Chi square
 
The Chi Square Test
The Chi Square TestThe Chi Square Test
The Chi Square Test
 
Goodness of Fit Notation
Goodness of Fit NotationGoodness of Fit Notation
Goodness of Fit Notation
 
Two Proportions
Two Proportions  Two Proportions
Two Proportions
 
Chi square
Chi squareChi square
Chi square
 
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
 
Topic 7 stat inference
Topic 7 stat inferenceTopic 7 stat inference
Topic 7 stat inference
 
Intro to tests of significance qualitative
Intro to tests of significance qualitativeIntro to tests of significance qualitative
Intro to tests of significance qualitative
 
Unit 3
Unit 3Unit 3
Unit 3
 
chi square statistics
chi square statisticschi square statistics
chi square statistics
 
Basics of Hypothesis Testing
Basics of Hypothesis Testing  Basics of Hypothesis Testing
Basics of Hypothesis Testing
 
Testing of Hypothesis.pdf
Testing of Hypothesis.pdfTesting of Hypothesis.pdf
Testing of Hypothesis.pdf
 
Ad test
Ad testAd test
Ad test
 

Mais de Sharlaine Ruth

Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test Sharlaine Ruth
 
Tetrachoric Correlation Coefficient
Tetrachoric Correlation CoefficientTetrachoric Correlation Coefficient
Tetrachoric Correlation CoefficientSharlaine Ruth
 
Spearman’s Rank Correlation Coefficient
Spearman’s Rank Correlation CoefficientSpearman’s Rank Correlation Coefficient
Spearman’s Rank Correlation CoefficientSharlaine Ruth
 
Simple Linear Regression
Simple Linear RegressionSimple Linear Regression
Simple Linear RegressionSharlaine Ruth
 
Point Bicerial Correlation Coefficient
Point Bicerial Correlation CoefficientPoint Bicerial Correlation Coefficient
Point Bicerial Correlation CoefficientSharlaine Ruth
 
Pearson product moment correlation
Pearson product moment correlationPearson product moment correlation
Pearson product moment correlationSharlaine Ruth
 
ANOVA-One Way Classification
ANOVA-One Way ClassificationANOVA-One Way Classification
ANOVA-One Way ClassificationSharlaine Ruth
 
ANOVA 2-WAY Classification
ANOVA 2-WAY ClassificationANOVA 2-WAY Classification
ANOVA 2-WAY ClassificationSharlaine Ruth
 
Portfolio Assessment Methods
Portfolio Assessment MethodsPortfolio Assessment Methods
Portfolio Assessment MethodsSharlaine Ruth
 
Probability Deck of Cards
Probability Deck of CardsProbability Deck of Cards
Probability Deck of CardsSharlaine Ruth
 

Mais de Sharlaine Ruth (13)

Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test Wilcoxon Signed Rank Test
Wilcoxon Signed Rank Test
 
Kruskal-Wallis H test
Kruskal-Wallis H testKruskal-Wallis H test
Kruskal-Wallis H test
 
Tetrachoric Correlation Coefficient
Tetrachoric Correlation CoefficientTetrachoric Correlation Coefficient
Tetrachoric Correlation Coefficient
 
Spearman’s Rank Correlation Coefficient
Spearman’s Rank Correlation CoefficientSpearman’s Rank Correlation Coefficient
Spearman’s Rank Correlation Coefficient
 
Simple Linear Regression
Simple Linear RegressionSimple Linear Regression
Simple Linear Regression
 
Point Bicerial Correlation Coefficient
Point Bicerial Correlation CoefficientPoint Bicerial Correlation Coefficient
Point Bicerial Correlation Coefficient
 
Phi (φ) Correlation
Phi (φ) CorrelationPhi (φ) Correlation
Phi (φ) Correlation
 
Pearson product moment correlation
Pearson product moment correlationPearson product moment correlation
Pearson product moment correlation
 
ANOVA-One Way Classification
ANOVA-One Way ClassificationANOVA-One Way Classification
ANOVA-One Way Classification
 
ANOVA 2-WAY Classification
ANOVA 2-WAY ClassificationANOVA 2-WAY Classification
ANOVA 2-WAY Classification
 
The Sign Test
The Sign TestThe Sign Test
The Sign Test
 
Portfolio Assessment Methods
Portfolio Assessment MethodsPortfolio Assessment Methods
Portfolio Assessment Methods
 
Probability Deck of Cards
Probability Deck of CardsProbability Deck of Cards
Probability Deck of Cards
 

Último

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
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 17Celine George
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
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 FellowsMebane Rash
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
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.pptxAmanpreet Kaur
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 

Último (20)

Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
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
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
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
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
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
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 

Goodness of fit (ppt)

  • 2. In general, the chi-square test statistic is of the form If the computed test statistic is large, then the observed and expected values are not close and the model is a poor fit to the data.
  • 3. 2  …the distribution with n - 1 degrees of freedom.
  • 5.
  • 6. When to Use the Chi-Square Goodness of Fit Test The chi-square goodness of fit test is appropriate when the following conditions are met: •The sampling method is simple random sampling. •The population is at least 10 times as large as the sample. •The variable under study is categorical. •The expected value of the number of sample observations in each level of the variable is at least 5. This approach consists of four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret
  • 7. State the Hypotheses Every hypothesis test requires the analyst to state a null hypothesis and an alternative hypothesis. The hypotheses are stated in such a way that they are mutually exclusive. That is, if one is true, the other must be false; and vice versa. For a chi-square goodness of fit test, the hypotheses take the following form. H : The data are consistent with a specified 0 distribution. Ha: The data are not consistent with a specified distribution. Typically, the null hypothesis specifies the proportion of observations at each level of the categorical variable. The alternative hypothesis is that at least one of the specified proportions is not true.
  • 8. Formulate an Analysis Plan The analysis plan describes how to use sample data to accept or reject the null hypothesis. The plan should specify the following elements. •Significance level. Often, researchers choose significance levels equal to 0.01, 0.05, or 0.10; but any value between 0 and 1 can be used. •Test method. Use the chi-square goodness of fit test to determine whether observed sample frequencies differ significantly from expected frequencies specified in the null hypothesis. The chi-square goodness of fit test is described in the next section, and demonstrated in the sample problem at the end of this lesson.
  • 9. Analyze Sample Data Using sample data, find the degrees of freedom, expected frequency counts, test statistic, and the P-value associated with the test statistic. •Degrees of freedom. The degrees of freedom (DF) is equal to the number of levels (k) of the categorical variable minus 1: DF = k - 1 . •Expected frequency counts. The expected frequency counts at each level of the categorical variable are equal to the sample size times the hypothesized proportion from the null hypothesis Ei = npi where Ei is the expected frequency count for the ith level of the categorical variable, n is the total sample size, and pi is the hypothesized proportion of observations in level i.
  • 10. •Test statistic. The test statistic is a chi-square random variable (Χ2) defined by the following equation. Χ2 = Σ [ (Oi - Ei)2 / Ei ] where Oi is the observed frequency count for the ith level of the categorical variable, and Ei is the expected frequency count for the ith level of the categorical variable. •P-value. The P-value is the probability of observing a sample statistic as extreme as the test statistic. Use the degrees of freedom computed.
  • 11. Interpret Results If the sample findings are unlikely, given the null hypothesis, the researcher rejects the null hypothesis. Typically, this involves comparing the P-value to the significance level, and rejecting the null hypothesis when the P-value is less than the significance level.
  • 12. Problem Acme Toy Company prints baseball cards. The company claims that 30% of the cards are rookies, 60% veterans, and 10% are All-Stars. The cards are sold in packages of 100. Suppose a randomly-selected package of cards has 50 rookies, 45 veterans, and 5 AllStars. Is this consistent with Acme's claim? Use a 0.05 level of significance.
  • 13. Solution The solution to this problem takes four steps: (1) state the hypotheses, (2) formulate an analysis plan, (3) analyze sample data, and (4) interpret results. We work through those steps below: 1. State the hypotheses. The first step is to state the null hypothesis and an alternative hypothesis. •Null hypothesis(H0): The proportion of rookies, veterans, and All-Stars is 30%, 60% and 10%, respectively. •Alternative hypothesis(Ha): At least one of the proportions in the null hypothesis is
  • 14. 2. Formulate an analysis plan. For this analysis, the significance level is 0.05. Using sample data, we will conduct a chi-square goodness of fit test of the null hypothesis. 3. Analyze sample data. Applying the chi-square goodness of fit test to sample data, we compute the degrees of freedom, the expected frequency counts, and the chi-square test statistic. Based on the chi-square statistic and the degrees of freedom, we determine the P-value. DF = k - 1 3-1=2 (Ei) = n * pi (E1) = 100 * 0.30 = 30 (E2) = 100 * 0.60 = 60 (E3) = 100 * 0.10 = 10 Χ2 = Σ [ (Oi - Ei)2 / Ei ] Χ2 = [ (50 - 30)2 / 30 ] + [ (45 - 60)2 / 60 ] + [ (5 - 10)2 / 10 ] Χ2 = (400 / 30) + (225 / 60) + (25 / 10) = 13.33 + 3.75 + 2.50 = 19.58 where DF is the degrees of freedom, k is the number of levels of the categorical variable, n is the number of observations in the sample, Ei is the expected frequency count for level i, Oi is the observed frequency count for level i, and Χ2 is the chi-square test statistic. The P-value is the probability that a chi-square statistic having 2 degrees of freedom is more extreme than 19.58.
  • 15. 4. Interpret results. Since the P-value (0.0001) is less than the significance level (0.05), we cannot accept the null hypothesis. Note: If you use this approach on an exam, you may also want to mention why this approach is appropriate. Specifically, the approach is appropriate because the sampling method was simple random sampling, the population was more than 10 times larger than the sample, the variable under study was categorical, and each level of the categorical variable had an expected frequency count of at least 5.
  • 16. A new casino game involves rolling 3 dice. The winnings are directly proportional to the total number of sixes rolled. Suppose a gambler plays the game 100 times, with the following observed counts: Number of Sixes Number of Rolls 0 48 1 35 2 15 3 3 The casino becomes suspicious of the gambler and wishes to determine whether the dice are fair. What do they conclude?