**Chi Squared Goodness of Fit **

**Introduction**

The Chi-Squared (X^{2}) Goodness of Fit test is used to compare an observed sample distribution with the expected probability distribution. It is used in situations when there is a single population. There is only a hypothesis test (no confidence interval) for Chi-Squared, and the test is always right sided.

**X ^{2} Distribution**

- It is a continuous density curve.
- There is one parameter (degrees of freedom).
- All X
^{2}values are greater than zero. - For small degrees of freedom (df < 20), the X
^{2}distribution is skewed right.

**Example **

*A state university claims the following about its student body*:

Instate | Out of state | International |

81% | 11% | 8% |

*Using a simple random sample, you gather your own data:*

Instate | Out of state | International |

125 | 34 | 41 |

(Total = 200)

*Based on the data, is there enough evidence to disprove the university's claims?*

__Step 1__: Name Test: Chi-Squared Godness of Fit

__Step 2__: Define Test:

H_{o: }The actual population proportions are equal to the stated proportions.

H_{A}: The actual population proportions differ from the stated proportions.

__Step 3__: Assume \(H_0\) is true and define its normal distribution. Then check for specific *conditions* which vary depending on the type of hypothesis test.

1. Data is draw from a random sample

2. N > 10n

3. All expected counts are at least 5

__Step 4__: Using the normal distribution, calculate the test statistic and p-value.

**Test Statistic:**X

^{2}= Σ \((observed - expected)^2 \over expected \)

__\(\times\)__(stated %)

Instate | Out of state | International | |

University Claim | 81% | 11% | 8% |

Data from Sample | 125 | 34 | 41 |

Expected Count |
162 | 22 | 16 |

**Solving the test statistic by hand:**

X^{2} = \((125 - 162)^2 \over 162 \) + \((34 - 22)^2 \over 22 \) + \((41 - 16)^2 \over 16 \) = 54.059

**Solving the test statistic with calculator:**

L_{1} = observed, L_{2} = expected, L_{3} = (L_{1} - L_{2})^{2} / L_{2}

Put L_{3} value into 1 Var Stats ⇒ X^{2} = ΣX

**Finding the p-value**

In your calculator, go to 2nd VARS and scroll to the X^{2}cdf option. You will enter the following:

- The X
^{2}value as a lower limit - 999 as the upper limit
- the degrees of freedom
- Note: the degrees of freedom = the number of cells \(-\) 1

- All together, it looks like this: (X
^{2}, 999, df) ⇒ p-value

In this case, you will enter (54.059, 999, 2) and get a p-value of 1.82 \(\times\) 10^{-12}

__Step 5__: Analyze your results and determine if they are *statistically significant.*

The p-value is approximately zero, which is less than the significance level of 0.05. Therefore, we reject the null hypothesis. The data supports the claim that the residency distribution differs from the stated resicency distribution on the website.