0% found this document useful (0 votes)
21 views35 pages

Lecture 17 - Ch10 - ChiSquare Test

Chapter 10 discusses the use of the Chi-square test for various statistical analyses, including testing goodness of fit, independence of variables, and homogeneity of proportions. It provides examples of how to apply the Chi-square test in real-world scenarios, such as consumer preferences for soda flavors and analyzing firearm-related deaths. The chapter also outlines the necessary hypotheses, degrees of freedom, and assumptions required for conducting these tests.

Uploaded by

roybaxolile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views35 pages

Lecture 17 - Ch10 - ChiSquare Test

Chapter 10 discusses the use of the Chi-square test for various statistical analyses, including testing goodness of fit, independence of variables, and homogeneity of proportions. It provides examples of how to apply the Chi-square test in real-world scenarios, such as consumer preferences for soda flavors and analyzing firearm-related deaths. The chapter also outlines the necessary hypotheses, degrees of freedom, and assumptions required for conducting these tests.

Uploaded by

roybaxolile
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

CHAPTER 10 APPM1022A

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

 Chi-squarestatistic can be used to see whether


a frequency distribution fits a specific pattern.
 For example,
A traffic engineer may wish to see whether
accidents occur more often on some days than on
others, so that she can increase police patrols
accordingly.
example

 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.

 The observed frequencies will almost always differ from the


expected frequencies due to sampling error; that is, the values
differ from sample to sample.
 What is the question of the interest in this case?
 Are these differences significant (a preference exists), or are
they due to chance?
 The chi-square goodness-of-fit test will enable the researcher to
determine the answer.
Hypotheses testing

 H0: Consumers show no preference for flavors of the


fruit soda, i.e, .
 Ha: Consumers show a preference.
Degree of freedom

 Inthe goodness-of-fit test, the degrees of freedom are


equal to the number of categories minus 1.
 For this example, there are five categories (cherry,
strawberry, orange, limon, and grape); hence, the
degrees of freedom are 5 -1 = 4.
Chi-Square Formula

,
 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

 Two assumptions are needed for the goodness-of-fit


test,
1. The data are obtained from a random sample,
2. The expected frequency for each category must
be 5 or more ().
Always remember for this test

This test is a right-tailed test, since when


the (O – E) values are squared, the answer
will be positive or zero.
Back to our example

 Is there enough evidence to reject the claim that there is no


preference in the selection of fruit soda flavors, using the data
shown previously? Let .
 Solution:
 Step 1: State the hypotheses and identify the claim.
 H0: Consumers show no preference for flavors (claim).
 Ha: Consumers show a preference.
 Step 2: Find the critical value. The degrees of freedom are 5-
1=4, and . Hence, the critical value from Chi-square table is is
9.488.
Cont.

 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 4: Make the decision.


 The decision is to reject the null hypothesis, since 18.0
is greater than 9.488.
 Step 5: With 95% confidence level, we conclude that
the consumers show a preference for a different types
of fruits.
Example

A researcher read that firearm-related deaths


for people aged 1 to 18 were distributed as
follows: 74% were accidental, 16% were
homicides, and 10% were suicides. In her
district, there were 68 accidental deaths, 27
homicides, and 5 suicides during the past year.
At , test the claim that the percentages are
equal.
Solution:

 Step 1: State the hypotheses and identify the claim


 H0: The deaths due to firearms for people aged 1
through 18 are distributed as follows: 74%
accidental, 16% homicides, and 10% suicides
(claim).
 Ha: The distribution is not the same as stated in the
null hypothesis.
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.

 Step4: Reject the null hypothesis, since 10.549 is


greater than 4.605.
 Step5: Summarize the results. There is enough
evidence to reject the claim that the distribution is
74% accidental, 16% homicides, and 10% suicides.
Tests Using Contingency
Tables
CHI-SQUARE TEST
Tests Using Contingency Tables

 When data can be tabulated in table form in terms of frequencies, several


types of hypotheses can be tested by using the chi-square test.
 Two such tests are the independence of variables test and the
homogeneity of proportions test.
 The test of independence of variables is used to determine whether two
variables are independent of or related to each other when a single sample is
selected.
 The test of homogeneity of proportions is used to determine whether the
proportions for a variable are equal when several samples are selected from
different populations.
Test for Independence

 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.

 Toanswer this question, a researcher selects a


sample of nurses and doctors and tabulates
the data in table form, as shown.
Cont.

Group Prefer Prefer No


New Old preferenc
Procedur Procedur e
e e
Nurses 100 80 20
Doctors 50 120 30
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.

 When data are arranged in table form for the chi-square


independence test, the table is called a contingency
table.
 The table is made up of R rows and C columns.
 The table in this example has two rows and three
columns.
 The degrees of freedom for any contingency table are
(rows -1) times (columns -1); that is, d.f.=(R -1)*(C -1).
 In this case, (2 -1)(3 -1)= (1)(2) = 2.
How to calculate the expected
values?

 Usingthe previous table, you can compute the


expected frequencies for each block (or cell), as
show:
 1.Find the sum of each row and each column, and
find the grand total, as shown.
Cont.

Group Prefer New Prefer Old No preference


Procedure Procedure
Total
Nurses 100 80 20 200
Doctors 50 120 30 200
50 400
Total 150 200
Grand total
Cont.

 2. For each cell, multiply the corresponding row sum by the


column sum and divide by the grand total, to get the
expected value:
 Expected value =
 For each cell, the expected values are computed as follows:


Cont.

 The expected values can now be placed in the corresponding cells


along with the observed values, as shown.

Group Prefer New Prefer Old No Total


Procedure Procedure preference
Nurses 100 80 20 200
Doctors 50 120 30 200
Total 150 200 50 400
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

 The second chi-square test that uses a contingency table is


called the homogeneity of proportions test.
 In this situation, samples are selected from several different
populations, and the researcher is interested in determining
whether the proportions of elements that have a common
characteristic are the same for each population.
 The hypotheses in this case would be
 H0: p1 = p2 =……= pk
 H1: At least one proportion is different from the others.
Example

Solved in the class.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy