Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

Chapter 7

Analysis of
Categorical Data
University of Economics
Ho Chi Minh City

Dang Van Thac 1/11


Outline

Contingency Analysis: Chi-Square


Test of Independence

Dang Van Thac 2/11


Contingency Analysis: Chi-Square Test of Independence

• Chi-square test of independence, can be used to analyze


the frequencies of two variables with multiple categories to
determine whether the two variables are independent.
For example: On a questionnaire, the following two questions might be
used to measure geographic region and type of financial investment.
In which region of the country do you reside?
A. Northeast B. Midwest C. South D. West
Which type of financial investment are you most likely to make today?
E. Stocks F. Bonds G. Treasury Bills

Dang Van Thac 3/11


Contingency Analysis: Chi-Square Test of Independence

• Chi-square test of independence:


2
2
(𝑓0 − 𝑓𝑒 )
𝜒 =
𝑓𝑒
Where:
df=(r-1)(c-1)
r=number of rows
C=number of columns

Dang Van Thac 4/11


Contingency Analysis: Chi-Square Test of Independence

Example:
Suppose a business researcher wants to determine whether type of
gasoline preferred is independent of a person’s income. She takes
a random survey of gasoline purchasers, asking them one question
about gasoline preference and a second question about income.
The respondent is to check whether he or she prefers (1) regular
gasoline, (2) premium gasoline, or (3) extra premium gasoline. The
respondent also is to check his or her income brackets as being (1)
less than $30,000, (2) $30,000 to $49,999, (3) $50,000 to $99,999,
or (4) more than $100,000. The business researcher tallies the
responses and obtains the results in Table 1. Using a = .01, she can
use the chi-square test of independence to determine whether
type of gasoline preferred is independent of income level.
Dang Van Thac 5/11
Contingency Analysis: Chi-Square Test of Independence

Table 1.

Dang Van Thac 6/11


Contingency Analysis: Chi-Square Test of Independence

Step 1: H0: type of gasoline is independent of income.


Ha: type of gasoline is not independent of income.
Step 2: The appropriate statistical test is Chi-square test of
independence.
Step 3: Alpha is 0.01.
Step 4: df=(4-1)(3-1)=6
2
The critical value of chi-square for 0.01 is: 𝜒0.01,6 = 16.8119
The decision rule is to reject H0 if the observed 𝜒 2 > 16.8119

Dang Van Thac 7/11


Contingency Analysis: Chi-Square Test of Independence

Step 5: the observed


data is in the table.
Step 6: compute the
observed value of chi-
square.
-we must compute the
expected frequencies
first.

Dang Van Thac 8/11


Contingency Analysis: Chi-Square Test of Independence

Dang Van Thac 9/11


Contingency Analysis: Chi-Square Test of Independence

Dang Van Thac 10/11


Contingency Analysis: Chi-Square Test of Independence

Step 7: the observed value of


chi-square (70.78) is greater than
the critical value of chi-square
(16.8119), the decision is to
reject H0. Thus, type of gasoline
is not independent of income
Dang Van Thac 11/11

You might also like