Upload
john-henry-valencia
View
225
Download
0
Embed Size (px)
Citation preview
8/13/2019 Chi Square report.pptx
1/35
John Henry O. Valencia, RN, RM, MANc
8/13/2019 Chi Square report.pptx
2/35
We often have occasions to make comparisons between two
characteristics of something to see if they are linked or related to each
other.
8/13/2019 Chi Square report.pptx
3/35
One way to do this is to work out what we would expect to find if there
was no relationship between them (the usual null hypothesis) and what
we actually observe.
The test we use to measure the differences between what is observed
and what is expected according to an assumed hypothesis is called the
chi-square test.
8/13/2019 Chi Square report.pptx
4/35
First and foremost, make sure you pronounce it
correctly, chi-square as in kite NOT chee as
in cheetah (Chee-Square?) or chaye as in ChaiTea (Chai-Square?)
8/13/2019 Chi Square report.pptx
5/35
Test for goodness of fit
Test for independence of attributes
Testing homogeneity
Testing given population variance
8/13/2019 Chi Square report.pptx
6/35
Identifies significant differences among
the observed frequencies and the expected
frequencies of a particular group.
Do the number of individuals or objects that fall in each category differ
from the number you would expect?
8/13/2019 Chi Square report.pptx
7/35
Attempts to identify whether any differences
between the expected and observed
frequencies are due to chance, or some
other factor that is affecting it.
Is this difference between the expected and observed are due to sampling
error, or is it a REALdifference?
8/13/2019 Chi Square report.pptx
8/35
Data- 2 types
Numerical data- in form of numbers. (ex.
1,2,3,4) Categorical data- comes in form of divisions.
(ex. Yes or no)
8/13/2019 Chi Square report.pptx
9/35
Observed Frequencies the observed frequencies are the frequencies actually
obtained in each cell of the table, from our random sample.
When conducting a chi-squared test, the term observed
frequencies is used to describe the actual data in the
contingency table.
Observed frequencies are compared with the expectedfrequencies and differences between them suggest that the
model expressed by the expected frequencies does not
describe the data well.
8/13/2019 Chi Square report.pptx
10/35
Expected Frequencies
values for parameters that are hypothesized to
occur
are the frequencies that you would predict
('expect') in each cell of the table, if you knew
only the row and column totals, and if you
assumed that the variables under comparison
were independent.
8/13/2019 Chi Square report.pptx
11/35
can be determined through:
a) Hypothesizing that the frequencies are equal for
each category.
b) Hypothesizing the values on the basis of some
prior knowledge.
c) A mathematical method
8/13/2019 Chi Square report.pptx
12/35
Contingency Tables Frequency table in which a sample from a population is classified
according to two attributes, which are divided in to two or more
classes .
A contingency table is used to summarise categorical data. It may beenhanced by including the percentages that fall into each category.
What you find in the rows of a contingency table is contingent upon
(dependent upon) what you find in the columns.
Can be:
2 x 2
h x k
8/13/2019 Chi Square report.pptx
13/35
Chi-square test for Independence
-This tests whether the categoryfrom which the data comes from
affects the data.
-May also be thought of as testing whether the categories in the
experiment prefercertain kinds of data.
Example: Is there a difference in the car choices of male andfemales?
8/13/2019 Chi Square report.pptx
14/35
Chi-square test for goodness-of-fit
-This tests whether the observeddata fitthe expecteddata.
Example: Do the car sales this year match the car sales last year?
(ie. Did we still sell around 50 blue cars? 25 red cars?)
8/13/2019 Chi Square report.pptx
15/35
The values of the parameters to be compared are
quantitative and nominal.
There should be one or more categories in the setup.
The observations should be independent of each other.
An adequate sample size. (At least 10)
Most of the time, it is the frequency of the observations
that are used.
8/13/2019 Chi Square report.pptx
16/35
Simple random sample
All observations must be used
The expected frequency in any one cell of thetable must be greater than 5.
The total number of observations must be
greater than 20.
8/13/2019 Chi Square report.pptx
17/35
2= (O E)2
E
2
= The value of chi squareO= The observed valueE= The expected value (O E)2= all the values of (O E) squared then addedtogether
8/13/2019 Chi Square report.pptx
18/35
1. State the hypotheses
2. State the level of significance
3. Set up a contingency table
4. Compute for the expected frequencies
5. Rearrange the table to show the observed and expected frequencies
on the columns
6. Determine the degree of freedom
7. Check the tabular Chi-squared value with your df and level of
significance
8. State your conclusion
8/13/2019 Chi Square report.pptx
19/35
A Nutrition and Dietetics Student wants to see whether the food
preferences of males and females differed. He tried to see whether males
or females had a general difference in the preference for cooked and raw
foods. A survey was conducted with the following results:
Twelve males preferred Cooked foods.
Eight males preferred Raw foods.
Five females preferred Cooked foods.
Five females preferred Caw foods.
8/13/2019 Chi Square report.pptx
20/35
H0: There is no significant difference between the food
preferences of males and females. / Food preference is
independent of gender.
H1: There is a significant difference between the food
preferences of males and females. / Food preference is
affected by gender.
8/13/2019 Chi Square report.pptx
21/35
= 0.05
0.05 is the level of significance for mostscientific experiments.
8/13/2019 Chi Square report.pptx
22/35
The contingency table summarizes the data.
The categories on the columns are the preferencesthat you are checking.
The categories on the rows are the populationswhose preferences are being
checked. A row total and column total is always included as well.
Preference Male Female Total (Row)
Cooked 12 5 17
Raw 8 5 13
Total (Column) 20 10 30
8/13/2019 Chi Square report.pptx
23/35
The chi-square test for independence usually uses the third method of getting
expected frequencies.
Expected Frequency = (Row Total)(Column Total)
Grand total
This expected frequency is computed for EACH cell.
Preference Male Female Total (Row)
Cooked (20)(17)/30 =11.33 (10)(17)/30 =5.67 17
Raw (13)(20)/30 =8.67
(13)(10)/30 =4.33
13
Total (Column) 20 10 30
8/13/2019 Chi Square report.pptx
24/35
Preference O E (O-E) (O-E)2 (O-E)2
E
Cooked Male 12 11.33 0.67 0.4489 0.0396
Cooked Female 5 5.67 -0.67 0.4489 0.0792
Raw Male 8 8.67 -0.67 0.4489 0.518
Raw Female 5 4.33 0.67 0.4489 0.1037
Total 0.2743
8/13/2019 Chi Square report.pptx
25/35
The degrees of freedom is:
df = (Rows 1)(Columns 1)
df = (21)(2
1) = 1
8/13/2019 Chi Square report.pptx
26/35
Checking the table, we see that the tabular
chi-squared value for df = 1, and = 0.05 is
3.841.
8/13/2019 Chi Square report.pptx
27/35
Since our calculated chi-square is less than this, the
conclusion is to ACCEPT THE NULL HYPOTHESIS.
Hence, food preference is independent of gender.
If it were greater, we would reject the null hypothesis.
8/13/2019 Chi Square report.pptx
28/35
Coding in SPSS:
Preference Male
(1)
Female
(2)
Total (Row)
Cooked
(1)
12 5 17
Raw
(2)
8 5 13
Total (Column) 20 10 30
8/13/2019 Chi Square report.pptx
29/35
A hospital employs a number of visiting surgeons to undertake
particular operations. If complications occur during or after the operation
the patient has to be transferred to a larger hospital nearby where the
required back up facilities are available.
A hospital administrator, worried by the effects of this on costs,
examines the records of the three surgeons. Surgeon A had 6 out of her
last 47 patients were transferred, Surgeon B, 4 out of his last 72 patients
and surgeon C, 14 out of his last 41.
Form the data into a 2 x 3 contingency table and test at the 5%
significance level, whether the proportion transferred is independent of
the surgeon.
8/13/2019 Chi Square report.pptx
30/35
H0: Patient transfer is independent of surgeons choice
or there is no association on transfer rate and the
surgeon
H1: patient transfer is affected by surgeons choice or
there is an association on transfer rate and the surgeon
Alpha Level:
= 0.05
8/13/2019 Chi Square report.pptx
31/35
SURGEON A B C TOTAL(ROW)
TRANSFERRED 6 4 14 24
NOT-TRANSFERRED 41 68 27 136
Total
(Column)
47 72 41 160
8/13/2019 Chi Square report.pptx
32/35
Since our calculated Chi Square is greater than the
critical value, the conclusion is to reject the null
hypotheses, hence, transfer rate is affected by
surgeonschoice / preference.
The difference between what we expected and our
observation were too great / large to be explained by
Chance alone.
8/13/2019 Chi Square report.pptx
33/35
A marketing firm producing detergents is interested
in studying the consumer behavior in the context ofpurchase decision of detergents in a specific market. It
would like to know in particular whether the income level
of the consumers influence their choice of the brand.
Currently there are two brands in the market. Brand 1 is
the premium brand while Brand 2 is the economy brand.
Income level was classified as Lower, Middle, Upper
Middle and High and random sampling procedure wasadopted covering the entire market. A sample of 300
consumers participated in this study. The following data
emerged from the study.
8/13/2019 Chi Square report.pptx
34/35
Analyze the data using chi-square testand draw your conclusions.
Income Level Brand 1 Brand 2
Lower 25 65Middle 30 30
Upper Middle 50 22
High 60 18
8/13/2019 Chi Square report.pptx
35/35