Lecture 17 - Ch10 - ChiSquare Test
Lecture 17 - Ch10 - ChiSquare Test
Statistic
THE TEST
The use of Chi-square
So far
The chi-square distribution was used in Chapters 9
to find a confidence interval for a variance or
standard deviation,
Testing
a hypothesis about a single variance or
standard deviation.
The use of Chi-square
Further use
Frequency distributions, testing the equality of different distributions,
Ifa sample of customers is given a choice of car colors, will each color be
selected with the same frequency?
Testing the independence of two variables,
Are the politician’ opinions on immigration control independent of party
affiliations?
Testing the homogeneity of proportions,
Isthe proportion of high school seniors who attend university immediately after
graduating the same for all the provinces of the South Africa?
And many use in statistic.
Test for Goodness of Fit
A market analyst wishes to see whether consumers have any preference among
five flavors of a new fruit soda. A sample of 100 people provided these data:
Frequency Cherry Strawberr Orange Limon Grape
y
Observed 32 28 16 14 10
If there were no preference, you would expect each flavor to be selected with
equal frequency, i.e., .
In this case, the equal frequency is . That is, approximately 20 people would
select each flavor.
Cont.
Since
the frequencies for each flavor were obtained from a
sample, these actual frequencies are called the observed
frequencies.
Thefrequencies obtained by calculation (as if there were
no preference) are called the expected frequencies.
A completed table for the test is shown.
Cont.
╔═══════════╦════════╦════════════╦════════╦══════╦═══════╗
║ Frequency ║ Cherry ║ Strawberry ║ Orange ║ Limon ║ Grape
║
╠═══════════╬════════╬════════════╬════════╬══════╬═══════╣
║ Observed ║ 32 ║ 28 ║ 16 ║ 14 ║ 10
║
╠═══════════╬════════╬════════════╬════════╬══════╬═══════╣
║ Expected ║ 20 ║ 20 ║ 20 ║ 20 ║ 20
║
╚═══════════╩════════╩════════════╩════════╩══════╩═══════╝
Cont.
,
with
degrees of freedom equal to the number of
categories minus 1, and where
O is the observed frequency,
E is the expected frequency.
Assumptions to use the test
Step 3: Compute the test value by subtracting the expected value from the
corresponding observed value, squaring the result and dividing by the expected
value, and finding the sum. The expected value for each category is 20, as shown
previously.
Cont.
Step 2: Find the critical value. Since and the degrees of freedom are 3 -1= 2, the
critical value is 4.605.
Step 3: Compute the test value. The expected values are as follows.
Step 3 Compute the test value. The expected values are as follows:
0.74 *100= 74
0.16 * 100= 16
0.10* 100 =10
Cont.
The chi-square independence test can be used to test the independence of two
variables.
Example
Suppose a new postoperative procedure is administered to a number of patients in a
large hospital.
The researcher can ask the question, Do the doctors feel differently about this
procedure from the nurses, or do they feel basically the same way?
Note that the question is not whether they prefer the procedure but whether there is
Cont.
Hypotheses:
H0: The opinion about the procedure is independent of the profession.
Ha: The opinion about the procedure is dependent on the profession.
To test the null hypothesis by using the chi-square
independence test, you must compute the expected
frequencies, assuming that the null hypothesis is true.
These frequencies are computed by using the observed
frequencies given in the table.
Cont.
Cont.
The formula for the test value for the independence test is the same as
the one used for the goodness-of-fit test. It is
Cont.
The final steps are to make the decision and summarize the
results.
This test is always a right-tailed test, and the degrees of freedom
are (R-1)(C-1)= (2-1)(3-1)= 2.
If , the critical value from Chi-square Table is 5.991.
Hence, the decision is to reject the null hypothesis since 26.67 >
5.991.
The conclusion is that there is enough evidence to support the
claim that opinion is related to (dependent on) profession—that is,
that the doctors and nurses differ in their opinions about the
Test for Homogeneity of Proportions