0% found this document useful (0 votes)
3 views

CH 11

Chapter 11 discusses chi-square tests of fit, including parametric and non-parametric tests, with a focus on the chi-square test for goodness-of-fit and independence. It provides examples of hypothesis testing, including null and alternative hypotheses, decision rules, and the interpretation of results. The chapter emphasizes the significance of the chi-square distribution and its application in analyzing categorical data.

Uploaded by

김봉기
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

CH 11

Chapter 11 discusses chi-square tests of fit, including parametric and non-parametric tests, with a focus on the chi-square test for goodness-of-fit and independence. It provides examples of hypothesis testing, including null and alternative hypotheses, decision rules, and the interpretation of results. The chapter emphasizes the significance of the chi-square distribution and its application in analyzing categorical data.

Uploaded by

김봉기
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 43

CHAPTER 11

CHI-SQUARE TESTS OF FIT


2

Parametric and non-parametric tests


• Parametric tests: statistical tests that require making
assumptions about parameters
• Example: z-tests, t-tests, and F-tests
• Mu = 80, mu not equal to 80; parameter에 대한 가정
(population mean과 sample mean비교)
• Interval, ratio
• Nominal, ordinal – parameter 를 가정하기 어렵다.
• 모집단 = 정규분포
• 목적: sample을 통해 parameter를 추정
• Non-parametric tests: statistical tests that do not
require making assumptions about parameters
• Example: χ2
• 모집단이 정규분포가 아니어도 된다.
• 목적: fit, 관찰한 데이터가 model과 fit한가를 검증
Chi-Square

• Chi-squared tests measure the fit between actual data and


expected data
• Goodness-of-fit: a non-parametric test, χ2 test, in which a set
of observed frequencies on a single variable is compared to a
model of expected frequencies
• Example: Is one ice cream flavour preferred by customers? (no
preference – model)
• 초코, 바닐라, 딸기: 20, 20, 20 (expected frequency, no preference,
model)
• 초코, 바닐라, 딸기: 10, 40, 10 (observed frequency)
• Test of independence: a non-parametric test, χ2 test, in which
two nominal variables are compared to determine if they are
independent from one another (independent – model)
• Example: Does ice cream preference differ by age of customer?
Goodness-of-Fit Test Example
Bubba’s Fish and Pasta is a chain of restaurants along the Gulf Coast of
Florida. Bubba is considering adding steak to the menu. Before doing so, he
hires a research firm to conduct a survey to find out what the patron’s favorite
meal is when eating out. Here are the results of the survey of 120 adults.

Is it reasonable to conclude
there is no preference among
the four entrées?

Is the difference in the number of


times each entrée is selected due
to chance, or should we conclude
that the entrées are not equally
preferred?
Goodness-of-Fit Test Example Continued
Step 1: State the null and the alternate hypothesis
H0: There is no difference in the proportion of adults selecting each entrée
H1: There is a difference in the proportion of adults selecting each entrée
Step 2: Select the level of significance, we select .05
Step 3: Select the test statistic, we’ll use chi-square, χ2
Step 4: Formulate the decision rule, reject H0 if 𝜒2 >7.815
Goodness-of-Fit Test Example Concluded

Step 5: Take sample, make decision, do not reject H0, 2.200 is not greater than
7.815

Step 6: Interpret, the data do not suggest the preferences among the four
entrées are different.
7

Chi-Squared tests: Research questions

• Research questions for chi-squared goodness-of-fit


tests question the assumed model and are always non-
directional & they should emphasize the number of
levels being tested.
• Example: Are any of the categories of the variable chosen more
often?
• Are any of the three gums chosen more often by focus group
participants?
• Research questions for chi-squared test of
independence tests question the assumed model and
should emphasize the two variables being tested.
• Example: Does preference for variable 1 differ by variable 2?
• Does gum preference differ by gender?
8

Chi-Squared tests: Hypotheses

• Hypotheses for the chi-square goodness-of-fit test use the


format:
• H0: There is no difference between observed and expected
frequencies of the variable.
• H1: There is a difference between observed and expected
frequencies of the variable.
• Hypotheses for the chi-square test of independence use
the format:
• H0: Preference for variable 1 is independent of variable 2.
• H1: Preference for variable 1 is not independent of Variable 2.
9

Chi-Squared goodness-of-fit: Critical values and


decision rules
• The critical value for the chi-squared goodness-of-fit
depends on alpha and the degrees of freedom for the
test
• Example: If α = .05 and k = 3, χ2crit(2) = 5.991
10

• The critical value for the chi-squared test of


independence depends on alpha and the
degrees of freedom for the test
• Example: If α = .05, k1 = 4, and k2 = 3, χ2crit(6) =
12.592 (4-1)(3-1) = 6
Chi-Square Characteristics
• The characteristics of the chi-square distribution are
• The value of chi-square is never negative
• There is a family of chi-square distributions
• The chi-square distribution is positively skewed
• As the degrees of freedom increase, the distribution
approaches a normal distribution
Chi-Squared tests: Conducting the statistical test

• Calculate the chi-squared tests using the following


formula:
Chi-Squared tests: Formally stating the results & conducting supplemental
analyses
• We formally state the results of chi-squared tests using the format:
• χ2(df) = χ2, p = p-value or relationship α
• Example: χ2(1) = 7.20, p = .01 or p < .05
• If we found statistical significance, compute an effect size.
• If we did not find statistical significance, no further analyses needed.
• Calculate an effect size using the formula: Cramer’s V
14

Hypothesis testing using chi-squared goodness-of-fit


test: Example

• Acme Co. has designed three new products. The


company wants to know if any of the products are
preferred by customers. To test this, they recruit 12
customers to participate in a focus group. They
demonstrate all three products and then ask the
customers to pick which one they prefer. Data is
provided below:

Product A Product B Product C


2 5 5
15

• RQ: Do customers indicate a preference for one of the


three products?
• Hypotheses:
• H0: There is no difference between observed and expected
frequencies of product preference.
• H1: There is a difference between observed and expected
frequencies of product preference.
• α = .05
• χ2crit(2)= 5.991
16

Category Observed Expected (O - E) (O - E)2 (O - E)2 / E


Product A 2 4 -2 4 1
Product B 5 4 1 1 0.25
Product C 5 4 1 1 0.25

• χ2 = 1 + .25 + .25 = 1.5


• χ2 (2) = 1.5 p > .05
• Retain the null. The chi-squared was not statistically
significant. There is insufficient evidence that there is a
difference between observed and expected frequencies of
product preference.
17

Learning check
• Beta Inc. wants to know whether men and women are
being promoted at equal rates within the company. They
research the gender of all employees promoted within the
past year. Data is provided below:

Male Female
28 12
18

Learning check

• RQ: Are men and women being promoted at equal


rates?
• Hypotheses:
• H0: There is no difference between observed and expected
frequencies of promotion by gender.
• H1: There is a difference between observed and expected
frequencies of promotion by gender.
• α = .05
• χ2crit(1)= 3.841
19

Category Observed Expected (O - E) (O - E)2 (O - E)2 / E


Male 28 20 8 64 3.2
Female 12 20 -8 64 3.2
• χ2 = 3.2 + 3.2 = 6.4
• χ2 (1) = 6.4 p < .05

φc = 6.4 =.4
40(2-1)
• Reject the null and accept the alternative. The chi-
squared is statistically significant. Men and women are
promoted at different rates. Cramer's V was 0.40. Men are
promoted more often than women. (.1 = small, .3 =
medium, .5= large)
20

Hypothesis Test of Unequal Expected Frequencies


Example

• The American Hospital Administration Association reports the number of


times senior citizens are admitted to a hospital during a one-year period;
40% are not admitted, 30% are admitted once, 20% are admitted twice, and
10% are admitted 3 or more times.

• Then, a survey of 150 residents of Bartow Estates, a community devoted to


active seniors located in central Florida revealed 55 residents were not
admitted, 50 were admitted once, 32 were admitted twice, and the rest in
the survey were admitted three or more times. Can we conclude the survey
at Bartow Estates is consistent with the information reported by the AHAA?
21

Step 1: State the null and alternate hypothesis


H0: There is no difference between local and national experience for hospital
admissions
H1: There is a difference between local and national experience for hospital
admissions
Step 2: Select the level of significance, we select .05
Step 3: Select the test statistic, we’ll use χ2
Step 4: Formulate the decision rule, reject H0 if χ2 >7.815
Step 5: Calculate the test statistic, make decision, do not reject H0,1.3723 < 7.815
Step 6: Interpret, there is no evidence of a difference between the local and the national
experience for hospital admissions
Contingency Table
• Contingency Table: a table splitting counts of two variables by the
categories they contain
• Includes total columns and rows
• Used in chi-squared test of independence
• We can use a contingency table to test whether two traits or
characteristics are related
• The expected frequency will be determined as follows

• The degrees of freedom = (Rows – 1)(Columns – 1)


• Example
• Ford Motor Company operates the Dearborn plant with 3 shifts per day, 5
days a week. Vehicles are classified as to quality level (acceptable,
unacceptable) and shift (day, afternoon, night). Is there a difference in the
quality level on the three shifts?
Expected vs. Observed
Gum preference

Observed Chew With/Flavor Competitor #1 Competitor #2 Total


Gender Male 3 11 3 17
Female 7 3 6 16
Total 10 14 9 33

Gum preference
Expected Chew With/Flavor Competitor #1 Competitor #2 Total

Gender Male (17*10)/33=5.151515 (17*14)/33=7.212121 (17*9)/33=4.636364 17

Female (16*10)/33=4.848485 (16*14)/33=6.787879 (16*9)/33=4.363636 16

Total 10 14 9 33
• Contingency table demonstrating non-significant
goodness-of-fit tests and test of independence.
25

• Contingency table demonstrating significant goodness-


of-fit test but non-significant test of independence.

• Contingency table demonstrating significant test of


independence.
Contingency Table Example
Rainbow Chemical, Inc. employs hourly and salaried employees. The vice
president of human resources surveyed 380 employees about his/her satisfaction
level with the current health care benefits program. The employees were then
classified according to pay type, salary or hourly. Is it reasonable to conclude that
pay type and level of satisfaction with the health care benefits are related?

Step 1: State the null and alternate hypothesis


H0: There is no relationship between level of satisfaction and pay type
H1: There is a relationship between level of satisfaction and pay type
Step 2: Select the level of significance, we select .05
Step 3: Select the test statistic, we’ll use chi-square, χ2
Contingency Table Example Continued

Step 4: Formulate the decision rule, reject H0 if chi-square > 5.991

Step 5: Make decision, chi-square is 2.506, do not reject H0

Step 6: Interpret, the sample data do not provide evidence that pay type and
satisfaction level with health care benefits are related.
28

Hypothesis testing using chi-squared test of independence:


Example

• The owner of I Scream Ice Cream Shop wants to know


whether the her three flavours of ice cream are
preferred differently between men and women. To test
this, she records the gender and flavour preference for
120 customers. Data is provided below:

Male Female
Flavor A 29 11
Flavor B 20 8
Flavor C 23 29
29

• RQ: Does ice cream flavor preference differ by gender?


• Hypotheses:
• H0: Preference for ice cream flavour is independent of gender.
• H1: Preference for ice cream flavour is not independent of
gender.
• α = .05
• χ2crit(2)= 5.991
30

• Observed Values • Expected Values

Male Female Total Male Female Total

Flavor A 29 11 40 Flavor A 24.00 16.00 40

Flavor B 20 8 28 Flavor B 16.80 11.20 28

Flavor C 31.20 20.80 52


Flavor C 23 29 52

Total 72 48 120 Total 72 48 120

• (O - E)2 / E Values

Male Female
Flavor A 1.04 1.56
Flavor B 0.61 0.91
Flavor C 2.16 3.23
31

• χ2 = 1.04 + .61 + 2.16 + 1.56 + .91 + 3.23 = 9.51


• χ2 (2) = 9.51 p < .05
9.15
φc = = .281514
120(2 -1)

• Reject the null and accept the alternative. The chi-


squared is statistically significant. Preferences for
different ice cream flavours are not independent of
gender. Cramer's V was 0.28. Flavours A and B are
preferred more by men than would be expected by
flavour or gender alone.
32

Learning check
• Beta Inc. wants to know whether the number of
employees calling out sick varies based on the shift
worked. The company tracks whether employees on
each shift call in sick for the three shifts. Data is
provided below:
Sick Not sick
Day 7 10
Evening 10 6
Night 13 14
33

Learning check
• RQ: Does whether an employee calls out sick differ by the
shift worked?
• Hypotheses:
• H0: Whether an employee calls out sick is independent of the shift
worked.
• H1: Whether an employee calls out sick is not independent of the
shift worked.
• α = .05
• χ2crit(2)= 5.991
34

Learning check
• Observed Values • Expected Values

Sick Not Sick Total Sick Not Sick Total

Day 7 10 17 Day 8.5 8.5 17


10 6
Evening 16 Evening 8 8 16

Night 13 14 27 Night 13.5 13.5 27

Total 30 30 60 Total 30 30 60
• (O - E)2 / E Values

Sick Not Sick


Day .26 .26
Evening 0.5 0.5
Night .02 .02
35

Learning check

• χ2 = .26 + .5 + .02 + .26 + .5 + .02 = 1.56


• χ2 (2) = 1.56 p > .05
• Retain the null. The chi-squared was not statistically
significant. There is insufficient evidence to conclude
that whether an employees calls out sick is not
independent of shift worked.
15-36

Limitations of Chi-Square
• If there is an unusually small frequency in a cell, chi-
square might result in an erroneous conclusion
• A very small number in the denominator, can
make the quotient quite large
• For only two cells, the fe should be at least 5
• Goodness of fit: category – male female
• For more than two cells, chi-square should not be
used if more than 20% of the fe cells have an expected
frequency that is less than 5
관리자
수준 fO fe
사원 30 32 관리자
대리 110 113 수준 fO fe
과장 86 87 The issue can be resolved 사원 30 32
부장 23 24
by combining categories if 대리 110 113
it is logical to do so. In this
차장 5 2 과장 86 87
example, we combine the
부사장 5 4 three vice president 부장 23 24
사장 4 1 categories, which satisfies 부사장 14 7
합계 263 263
the 20% policy. 합계 263 263
1

Goodness-of-Fit Test
• A goodness-of-fit test can be used to determine whether a
sample of observations is from a normal population
1. Calculate the mean and standard deviation of the sample data
2. Group the data into a frequency distribution
3. Convert the class limits to z values and find the standard normal
probability distribution for each class
4. For each class, find the expected normally distributed frequency by
multiplying the standard normal probability distribution by the class
frequency
5. Calculate the chi-square goodness-of-fit statistic based on the observed
and expected class frequencies
6. Find the expected frequency in each cell by determining the product of the
probability of finding a value in each cell by the total number of
observations
7. If we use the information on the sample mean and the sample standard
deviation from the sample data, the degrees of freedom are k – 3
Goodness of fit test df: k-1, parameter 1개당 1df 소모, (k-1)-2
Hypothesis Test that a Distribution is Normal Example
We investigate whether the profit data of Applewood Auto Group follows the
normal distribution. mean profit = $1,843.17, standard deviation = $643.63.

Now, calculate z values to calculate the area of probability for each of the eight classes. This
multiplied by the total, 180, will represent the expected frequencies for each class.
x − xഥ $200−$1,843.17 x − xഥ $600−$1,843.17
z= = = -2.55 z= = = -1.93
s $643.63 s $643.63
P(x < $200) = P(z < -2.55) = .5000 - .4946 = .0054
P($200 < x < $600) = P(-2.55 < z < -1.93) = .0268 - .0054 = .0214
P(z < -1.93) – P (z < -2.55) = (0.5 – 0.4732) - .0054 = .0214
Hypothesis Test that a Distribution is Normal Example Continued
Now, combine the classes that have fe < 5.

Once that is done, we can calculate the chi-square statistic.


Hypothesis Test that a Distribution is Normal Example Concluded

Step 1: State the null and alternate hypothesis


H0: The population of profits follows the normal distribution.
H1: The population of profits does not follow the normal distribution.
Step 2: Select the level of significance, we select .05
Step 3: Select the test statistic, we’ll use chi-square, χ2
Step 4: Formulate the decision rule, reject H0 if χ2 > 11.070
Step 5: Make decision, χ2 = 5.220, we do not reject H0
fo −fe 2 8 −4.82 2 4−6.46 2
χ2=Σ = + ……… + 6.46 = 5.220
fe 4.82
Step 6: Interpret, we conclude the evidence does not suggest the distribution
of profits is other than normal.
1

Goodness-of-Fit Test
• H0: The population of clients follows a normal distribution.
• H1: The population of clients does not follow a normal distribution.
• 직원이 10명 이하인 50개의 기업을 임의로 추출. 평균 고객 수 = 44.8명,
표준편차 = 9.37명

• α = .05
• χ2crit(2)= 5.991 # of clients frequency
20-30 1
30-40 15
40-50 22
50-60 8
60-70 4
• We fail to reject the null hypothesis. This data could be from a normal
distribution.
• H0: The population of advertising expenses follows a normal distribution.
• H1: The population of advertising expenses does not follow a normal distribution.
• Advertising expenses data from 60 firms; mean = 52, sd = 11.32 (million dollars)

• α = .05
• χ2crit(2)= 5.991
Expenses frequency
25-35 5
35-45 10
45-55 21
55-65 16
65-75 8

• We fail to reject the null hypothesis. This data could be from a normal distribution.

You might also like