Student/Statistics/ChiSquareGoodnessOfFitTest/overview - Help

Student[Statistics][ChiSquareGoodnessOfFitTest] Overview

overview of the Chi Square Goodness Of Fit Test

Description

 • Chi-Squared Goodness of Fit Test is used to test how well the data in the observed sample reflects the data in the expected sample. The observed sample and the expected sample are given as histograms with the same set of bins. That is, each entry of observed and expected is a count of observations with particular characteristics (typically, the observations within a particular range). These characteristics are the same for corresponding entries of observed and expected.
 • Requirements for using Chi-Squared Goodness of Fit Test:
 1 The goal is to test if the observed sample follows the same the distribution as of the expected sample.
 2 The observed sample and the expected sample are given as histograms with the same set of bins.
 • The formula is:

${X}^{2}={\sum }_{i=1}^{N}\frac{{\left({\mathrm{observed}}_{i}-{\mathrm{expected}}_{i}\right)}^{2}}{{\mathrm{expected}}_{i}}$

 where $\mathrm{observed}$ and $\mathrm{expected}$ are the data in the observed sample and the expected sample respectively, $N$ is the sample size of the observed and the expected samples, and ${X}^{2}$ follows a Chi-Squared distribution with $N-1$ degrees of freedom.

Example

Sam was playing a dice game. The rules of the game were: for each turn, the player rolls three dice and wins only if three sixes are rolled. After ten failures, Sam suspected that the dice may have been tampered with. Sam stole the dice and brought them home, where he rolled them 1000 times - the observed sample.

He also had three dice he knew to be fair, and rolled those 1000 times - this is the expected sample. For each roll he recorded the number of sixes. The results were as follows:

 observed expected 0 sixes 580 570 1 six 354 360 2 sixes 63 64 3 sixes 3 6

Now he wants to test if the dice are fair or not.

 1 Determine the null hypothesis:
 Null Hypothesis: The three dice are fair. (Observed sample dose not differ from expected sample.)
 2 Substitute the information into the formula:
 $x=\frac{{\left(580-570\right)}^{2}}{570}+\frac{{\left(354-360\right)}^{2}}{360}+\frac{{\left(63-64\right)}^{2}}{64}+\frac{{\left(3-6\right)}^{2}}{6}=1.791063596$
 3 Compute the p-value:
 $p-\mathrm{value}=\mathrm{Probability}\left(Xˆ2>1.791063596\right)=0.616881663760937$,      $Xˆ2˜\mathrm{ChiSquare}\left(3\right)$
 4 Draw the conclusion:
 This statistical test does not provide enough evidence to conclude that the null hypothesis is false, so we fail to reject the null hypothesis.