Chapter Four
Chapter Four
CHI-SQUARE DISTRIBUTIONS
4. Introduction
There are two statistical methods used for hypothesis testing: the parametric and nonparametric.
The terms parametric statistics and nonparametric statistics refer to the two major groupings of
statistical procedures. The major distinction between them lies in the underlying assumptions
about the data to be analyzed. Parametric statistics involve numbers with known, continuous
distributions. When the data are interval or ratio scaled and the sample size is large, parametric
statistical procedures are appropriate.
Parametric statistics are based on the assumption that the data in the study are drawn from a
population with a normal (bell-shaped) distribution and/or normal sampling distribution. For
example, if an investigator has two interval-scaled measures, such as gross national product
(GNP) and industry sales volume, parametric tests are appropriate. Possible statistical tests might
include product-moment correlation analysis, analysis of variance, regression, or a t-test for a
hypothesis about a mean.
Nonparametric methods are used when the researcher does not know how the data are
distributed. Making the assumption that the population distribution or sampling distribution is
normal generally is inappropriate when data are either ordinal or nominal. Thus, nonparametric
statistics are referred to as distribution free. Data analysis of both nominal and ordinal scales
typically uses nonparametric statistical tests.
This chapter will teach you how to perform a statistical analysis when at least some of the
requirements of the standard statistical methods are not met. Nonparametric methods are
alternative statistical methods of analysis in such cases.
Many hypothesis-testing situations have nonparametric alternatives to be used when the usual
assumptions we make are not met. In other situations, nonparametric methods offer unique
solutions to problems at hand. Because a nonparametric test usually requires fewer assumptions
and uses less information in the data, it is often said that a parametric procedure is an exact
1
solution to an approximate problem, whereas a nonparametric procedure is an approximate
solution to an exact problem.
In short, we define a nonparametric method as one that satisfies at least one of the following
criteria.
1. The method deals with enumerative data (data that are frequency counts).
2. The method does not deal with specific population parameters such as µ or σ.
3. The method does not require assumptions about specific population distributions (in
particular, the assumption of normality).
Since nonparametric methods require fewer assumptions than do parametric ones, the methods
are useful when the scale of measurement is weaker than required for parametric methods.
A chi-square (X2) test is one of the most basic tests for statistical significance and is particularly
appropriate for testing hypotheses about frequencies arranged in a frequency or contingency
table. Univariate tests involving nominal or ordianal variables are examined with a χ2. More
generally, the χ2 test is associated with goodness-of-fit (GOF). GOF can be thought of as how
well some matrix (table) of numbers matches or fits another matrix of the same size. Most often,
the test is between a table of observed frequency counts and another table of expected values
(central tendency) for those counts.
A goodness-of-fit test is a statistical test of how well our data support an assumption about the
distribution of a population or random variable of interest. The test determines how well an
assumed distribution fits the data.
In this section and the next two, we describe tests that make use of the chi-square distribution.
The data used in these tests are enumerative: The data are counts, or frequencies. Our actual
observations may be on a nominal (or higher) scale of measurement. Because many real-world
situations in business and other areas allow for the collection of count data (e.g., the number of
people in a sample who fall into different categories of age, sex, income, and job classification),
2
chi-square analysis is very common and very useful. The tests are easy to carry out and are
versatile: we can employ them in a wide variety of situations. The tests presented in this and the
next two sections are among the most useful statistical techniques of analyzing data. Quite often,
in fact, a computer program designed merely to count the number of items falling in some
categories automatically prints out a chi-square value. The user then has to consider the question:
What statistical test is implied by the chi-square statistic in this particular situation? Among their
other purposes, these sections should help you answer this question. We will discuss a common
principle of all the chi-square tests. The principle is summarized in the following steps:
1. We hypothesize about a population by stating the null and alternative hypotheses. Gather
data and tally the observed frequencies for the categorical variable.
2. Compute the expected values for each value of the categorical variable and calculate the
difference between the observed counts of each cell and expected values. We consider the
difference between the observed and the expected. The mean—the expected value—is
equal to the number of trials n times the probability of success in a single trial p.
The Expected count in cell i is: Ei = npi
3. Calculate the χ2 value, using the observed frequencies from the sample and the expected
frequencies.
The chi-square statistics is:
Rule: reject Ho, when the computed value is greater than the critical point with a given
level of significant level, α.
3
The analysis in this section and the next two involves tables of data counts. The chi-square
statistic has the same form in the applications in all three sections. The statistic is equal to the
squared difference between the observed count and the expected count in each cell, divided by
the expected count, summed over all cells. If our data table has k cells, let the observed count in
cell i be Oi and the expected count (expected under H0) be Ei.
As the total sample size increases, for a given number of cells k, the distribution of the statistic
X2 in equation 4. 1 approaches the chi-square distribution. The degrees of freedom of the chi-
square distribution are determined separately in each situation.
Remember the binomial experiment, where the number of successes (items falling in a
particular category) is a random variable. The probability of a success is a fixed number p.
Recall that as the number of trials n increases, the distribution of the number of binomial
successes approaches a normal distribution.
The multinomial distribution is a generalization of the binomial distribution to more than two
possibilities (success versus failure). In the multinomial situation, we have k > 2 possible
categories for the data. A data point can fall into only one of the k categories, and the
probability that the point will fall in category i (where i = 1, 2, . . ., k) is constant and equal to pi.
The sum of all k probabilities pi is 1.
Given five categories, for example, such as five age groups, a respondent can fall into only one
of the (nonoverlapping) groups. If the probabilities that the respondent will fall into any of the k
groups are given by the five parameters p1, p2, p3, p4, and p5, then the multinomial
distribution with these parameters and n, the number of people in a random sample, specifies the
probability of any combination of cell counts.
4
For example, if n = 100 people, the multinomial distribution gives us the probability that 10
people will fall in category 1; 15 in category 2; 12 in category 3; 50 in category 4; and the
remaining 13 in category 5. The distribution gives us the probabilities of all possible counts of
100 people (or items) distributed into five cells.
When we have a situation such as this, we may use the multinomial distribution to test how well
our data fit the assumption of k fixed probabilities p1, . . ., pk of falling into k cells. However,
working with the multinomial distribution is difficult, and the chi-square distribution is a very
good alternative when sample size considerations allow its use.
The null and the alternative hypothesis for the multinomial distribution are
HO: the probabilities of occurrence of events E1, E2, ……, Ek are given by the specified
probabilities P1, P2 …., Pk
H1: The Probabilities of K events are not the Pi stated in the null hypothesis
The test statistic is as given in equation 4.1. For large enough n (a rule for how large is “enough”
will be given shortly), the distribution of the statistic may be approximated by a chi-square
distribution with k - 1 degrees of freedom. We demonstrate the test with Example below.
Example 4.1 Alex company is about to come out with a new watch and wants to find out
whether people have special preferences for the color of the watchband, or whether all four
colors under consideration are equally preferred. A random sample of 80 prospective watch
buyers is selected. Each person is shown the watch with four different band colors and asked to
state his or her preference. The results—the observed counts— are given in Table below.
12 40 8 20 80
5
Ho: the four band colors are equally preferred; that is, the probabilities of choosing any of the
four colors are equal: p1 = P2 = P3 = P4= 0.25
H1: Not all four colors are equally preferred (the probabilities of choosing the four colors are not
equal).
Required: conduct the chi-square test. What is your decision at α = 0.01 level of significance?
Step 2. Calculate the expected value and then compute the difference between the expected
value and the observed one. The Expected count in cell i is: Ei = npi
E1 = E2 = E3 = E4 = (80) (0.25) = 20
Preferred color (K) Observed Value (Oi) Expected value (Ei) (Oi - Ei) (Oi - Ei)2
Red 12 20 -8 64
Blue 40 20 20 400
Black 20 20 0 0
Step 3. Calculate the χ2 value, using the observed frequencies from the sample and the expected
frequencies.
6
The chi-square statistics is:
❑ ❑ ❑
64 400 144 0
X2= + + + =3.2+ 20+7.2+0=30. 4
20 20 20 20
Step 4. Find the degrees of freedom for the test. Degree of freedom = K – 1, 4 – 1 = 3
Step 5. Make the statistical decision by comparing the critical value (p-value) associated with
the calculated χ2 against the predetermined significance level. We now conduct the test by
comparing the computed value of our statistic, X2 = 30.4, with critical points of the chi-square
distribution with k - 1 = 4 -1 = 3 degrees of freedom. From the chi square table, we find that the
critical point for a chi-square random variable with 3 degrees of freedom and right-hand-tail area
α = 0.01 is 11.3. (Note that all the chi-square tests in this chapter are carried out only on the
right-hand tail of the distribution.) Since the computed value is much greater than the critical
point at α = 0.01, we conclude that there is evidence to reject the null hypothesis that all four
colors are equally likely to be chosen. Some colors are probably preferable to others. Our p-value
is very small.
Example 4.2 A company is considering five possible names for its new product. Before
choosing a name, the firm decides to test whether all five names are equally appealing. A random
sample of 100 people is chosen, and each person is asked to state her or his choice of the best
name among the five possibilities. The numbers of people who chose each one of the names are
as follows.
Name A B C D E
Number of choices 4 12 34 40 10
7
Two events A and B are independent if the probability of their joint occurrence is equal to the
product of their marginal (i.e., separate) probabilities. This was given as:
In this section, we will develop a statistical test that will help us determine whether two
classification criteria, such as gender and job performance, are independent of each other. The
technique will make use of contingency tables— tables with cells corresponding to cross-
classifications of attributes or events. In market research studies, such tables are referred to as
cross-tabs. The basis for our analysis will be the property of independent events just stated.
The contingency tables may have several rows and several columns. The rows correspond to
levels of one classification category, and the columns correspond to another. We will denote
the number of rows by r, and the number of columns by c.
The total sample size is n, as before.
The count of the elements in cell (i, j), that is, the cell in row i and column j (where i = 1,
2, . . ., r and j = 1, 2, . . ., c), is denoted by Oij.
The total count for row i is Ri, and the total count for column j is Cj. The general form of a
contingency table is shown in table 4.2. The table is demonstrated for r = 5 and c = 6. Note
that n is also the sum of all r row totals and the sum of all c column totals.
8
H0: The two classification variables are independent of each other
The principle of our analysis is the same as that used in the previous section. The chi-square test
statistic for this set of hypotheses is the one we used before in goodness of fit. The only
difference is that the summation extends over all cells in the table: the c columns and the r
rows (in the previous application, goodness-of-fit tests, we only had one row). We will rewrite
the statistic to make it clearer:
The double summation in equation above means summation over all rows and all columns.
Now all we need to do is to find the expected cell counts Eij. Here is where we use the
assumption that the two classification variables are independent. Remember that the philosophy
of hypothesis testing is to assume that H 0 is true and to use this assumption in determining the
distribution of the test statistic. Then we try to show that the result is unlikely under H 0 and thus
reject the null hypothesis.
Assuming that the two classification variables are independent, let us derive the expected counts
in all cells. Look at a particular cell in row i and column j. Recall that the expected number of
items in a cell is equal to the sample size times the probability of the occurrence of the event
signified by the particular cell.
In the context of an r X c contingency table, the probability associated with cell (i, j) is the
probability of occurrence of event i and event j.
9
Thus, the expected count in cell (i, j) is Eij = nP(i Ո j). If we assume independence of the two
classification variables, then event i and event j are independent events, and by the law of
independence of events, P (i Ո j) P(i)P(j).
From the row totals, we can estimate the probability of event i as Ri/ n. Similarly, we estimate
the probability of event j by Cj/n. Substituting these estimates of the marginal probabilities, we
get the following expression for the expected count in cell (i, j): Eij = n(Ri/ n) (Cj/ n) = RiCj/n.
The equation above allows us to compute the expected cell counts. These, along with the
observed cell counts, are used in computing the value of the chi-square statistic, which leads us
to a decision about the null hypothesis of independence.
We will now illustrate the analysis with example. The example is an illustration of an analysis of
the simplest contingency table, a 2 X 2 table. In such tables, the two rows correspond to the
occurrence versus nonoccurrence of one event, and the two columns correspond to the
occurrence or nonoccurrence of another event.
Example 4.3 In order to study the profits and losses of firms by industry, a random sample of
100 firms is selected, and for each firm in the sample, we record whether the company made
money or lost money, and whether the firm is a service company. The data are summarized in
the 2 X 2 contingency table, Table 4.3. Using the information in the table, determine whether
you believe that the two events “the company made a profit this year” and “the company is in the
service industry” are independent.
Industry Type
Profit 42 18 60
Loss 6 34 40
Total 48 52 100
Table 4.3 is the table of observed counts. We now use its marginal totals R1, R2, C1, and C2 as
well as the sample size n, in creating a table of expected counts. Using equation 4.2, we get
We now arrange these values in a table of expected counts, table 43. Using the values shown in
the table, we now compute the chi-square test statistic the formula.
Observed count (Oij) Expected Count (Eij) (Oij - Eij) (Oij - Eij)2
11
34 20.8 13.2 174.24
❑ ❑ ❑
2 174.24 174.24 174.24 174.24
X = + + + =6.05+5.58+9.075+ 8.38=29 . 085
28.8 31.2 19.2 20.8
To conduct the test, we compare the computed value of the statistic with critical points of the
chi-square distribution with (r - 1)(c - 1) = (2 - 1)(2 - 1) = 1 degree of freedom. From the chi-
square table, we find that the critical point for α = 0.01 is 6.63, and since our computed value of
the X2 statistic is much greater than the critical point, we reject the null hypothesis and conclude
that the two qualities, profit/loss and industry type, are probably not independent.
Note that, In the analysis of 2 X 2 contingency tables, our chi-square statistic has 1 degree of
freedom.
Example 3.4 An article reports that smaller firms seem to be hiring more than large ones as the
economy picks up its pace. The table below gives numbers of employees hired and those laid off,
out of a random sample of 1,032, broken down by firm size. Is there evidence that hiring
practices are dependent on firm size? Use α = 0.01
12