Vous êtes sur la page 1sur 3

STAT 200

Elementary Statistics

11.2 - Goodness-of-Fit Test


Printer-friendly version (https://onlinecourses.science.psu.edu/stat200/print/book/export/html/470)
The chi-square goodness-of-fit test is used to compare proportions when we have one categorical variable that
has more than two levels. We can test that the proportions are all equal to one another or we can test any specific
set of proportions.

Possible Research Questions


When randomly selecting a card from a deck with replacement, are we equally likely to select a heart, diamond,
spade, and club?

This is an example with equal probabilities. It would translate to the following hypotheses:

H0 : ph = pd = ps = pc = 0.25

Ha : At least one pi is not as specif ied

According to one research study, 2% of Americans identify as homosexual, 2% as bisexual, and 96% as
heterosexual. Are these proportions different in the population of Penn State students?

In this example, the probabilities are not all equal. This would translate to the following hypotheses:

H0 : phomosexual = 0.02, pbisexual = 0.02, pheterosexual = 0.96

Ha : At least one pi is not as specif ied

Assumptions
In order to conduct a chi-square test (goodness-of-fit or test of independence) all expected counts (soon we'll see
that this is all np) need to be at least 5.

The categories must also all be mutually exclusive. In other words, each case may appear in only one category.

Test Statistic
In conducting a goodness-of-fit test, we compare the observed counts to the expected counts (also known as
expected values). Expected counts are computed given that the null hypothesis is true. This is the number of
cases we would expect to see in each cell if the null hypothesis were true.
Expected Count

Expected count = n(pi )

n is the total sample size


pi is the hypothesized proportion of the "ith" group

The observed and expected values are then used to compute the chi-square ( ) test statistic: 2

Chi-Square ( ) Test Statistic


2

2
(ObservedExpected)
2
=
Expected

Approximating the Sampling Distribution


StatKey (http://www.lock5stat.com/StatKey/) has the ability to conduct a randomization test for a goodness-of-fit test.
There is an example of this in section 7.1 of the Lock^5 textbook. If all expected values are at least five, then
the sampling distribution can be approximated using a chi-square distribution.

Like the t distribution, the chi-square distribution varies depending on the degrees of freedom. The distribution
plot below compares the chi-square distributions with 2, 4, and 6 degrees of freedom.

To find the p-value we find the area under the chi-square distribution to the right of our test statistic. A chi-
square test is always right-tailed.

Degrees of freedom for a chi-square goodness-of-fit test are equal to the number of groups minus 1.

11.2.1 - Examples (/stat200/node/471)


11.2.2 - Minitab Express: Goodness-of-Fit Test (/stat200/node/473)

11.1.3 - Probability Distribution Plots up 11.2.1 - Examples (/stat200/node/471)


(/stat200/node/468) (/stat200/node/71)

Vous aimerez peut-être aussi