Académique Documents
Professionnel Documents
Culture Documents
BY:
LJV & IKR
OBJECTIVES
Test a distribution for goodness of fit using chi-square. Test two variables for independence using chi-square. Test proportions for homogeneity using chi-square
INTRODUCTION
The chi-square distribution can be used for tests concerning frequency distributions, such as: If a sample of buyers is given a choice of automobile colors, will each color be selected with the same frequency?
INTRODUCTION ( CONTD )
The chi-square distribution can also be used to test the independence of two variables. For example, Are senators opinions on gun control independent of party af filiations?
INTRODUCTION ( CONTD )
The chi-squared distribution can be used to test the homogeneity of proportions. For example: Is the proportion of high school seniors who attend college immediately after graduating the same for the northern, southern, eastern, and western parts of the Iloilo City?
The chi-square statistic can be used to see whether a frequency distribution fits a specific pattern. This is referred to as the chi-squared goodness-of-fit test.
Since the frequencies for each flavor were obtained from a sample, these actual frequencies are called the observed frequencies. The frequencies obtained by calculation (as if there were no preference) are called the expected frequencies.
Cherry 32 20
Strawberry 28 20
Orange 16 20
Lime 14 20
Grape 10 20
GOODNESS-OF-FIT TEST
The formula for the chi -square goodness-of-fit test:
X 2 = (O E) 2 E
Where: O = the observed or obtained frequency E = the expected or theoretical frequency
df = (C 1) (R 1)
Where: C = the number of columns R = the number of rows
AN 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 = 0.05.
SOLUTION
STEP 1 State the hypotheses and identify the claim .
H0: Consumers show no preference for flavors (claim). H1 : Consumers show a preference.
STEP 2 Find the critical value. The degrees of freedom are 5 1=4, and = 0.05. Hence, the critical value from the table is 9.488 . STEP 3 Compute 2
X 2 = (O E) 2 = 18.0 E
SOLUTION ( CONTD )
STEP 4 Make the decision. The decision is to reject the null hypothesis, since 18.0 > 9.488.
SOLUTION ( CONTD )
STEP 5 Summarize the results . There is enough evidence to reject the claim that consumers show no preference for the flavors.
A GOOD FIT
When the observed values and expected values are close together, the chi-square test value will be small. Then the decision will be not to reject the null hypothesis hence, there is a good fit.
INDEPENDENCE TEST
The chi-square independence test can be used to test the independence of two variables . H0: There is no relationship between two variables. H1: There is a relationship between two variables. If the null hypothesis is rejected, there is some relationship between the variables.
AN EXAMPLE
Suppose a new postoperative procedure is administered to a number of patients in a large hospital. One can ask the question, Do the doctors feel dif ferently 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 a dif ference of opinion between the two groups.
AN EXAMPLE ( CONTD )
To answer this question, a researcher selects a sample of nurses and doctors and tabulates the data in table form, as shown. Group Nurses Doctors Prefer new 100 50 Prefer old 80 120 No Preference 20 30
AN EXAMPLE ( CONTD )
If the null hypothesis is not rejected, the test means that both professions feel basically the same way about the procedure and the dif ferences are due to chance. If the null hypothesis is rejected, the test means that one group feels dif ferently about the procedure from the other. Remember that rejection does not mean that one group favors the procedure and the other does not.
In order to test the null hypothesis, one must compute the expected frequencies, assuming the null hypothesis is true. When data are arranged in table form for the independence test, the table is called a contingency table.
CONTINGENCY TABLE
Row 1 Row 2
Column 1 C1 ,1 C2,1
Column 2 C1 ,2 C2,2
Column 3 C1 ,3 C2,3
X 2 = (O E) 2 E
Where: O = the obser ved or obtained frequency E = the expected or theoretical frequency and the degrees of freedom : d f = (C 1) (R 1) Where: C = the number of columns R = the number of rows
Group
No preference
Total
100 50 150
80 120 200
20 30 50
Grand Total
Group
No preference
Total
20(25) 30(25) 50
X 2 = (O E) 2 = 26.27 E
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.
PROCEDURE
The procedures for the chi-square independence and homogeneity tests are identical and summarized below. Step 1 State the hypotheses and identify the claim. Step 2 Find he critical value in the right tail. Step 3. Compute the test value. To compute the test value, first find the expected values. For each cell of the contingency table, use the formula E = (row sum)(column sum) grand total
PROCEDURE ( CONTD )
to get the expected value. To find the test value, use the formula
X 2 = (O E) 2 E
Step 4 Make the decision . Step 5 Summarize the results.
AN EXAMPLE
A researcher selected a sample of 150 seniors from each of three area high schools and asked each senior, Do you drive to school in a car owned by either you or your parents ?. The data are shown in the table. At = 0.05, test the claim that the proportion of students who drives their own or their parents cars is the same at all three schools .
School 1 School 2 School 3 Total
Yes No Total
18 32 50
22 28 50
16 34 50
56 94 150
SOLUTION
STEP 1 . State the hypotheses. H0: p1 = p2 = p3 H1: At least one proportion is dif ferent from the others. STEP 2. Find the critical value. The formula for the degrees of freedom is the same as before: (2 -1)(3-1)=2. The critical value is 5.991 . STEP 3. Compute the X test value. First, compute the expected values, and the complete table is shown.
SOLUTION ( CONTD )
School 1 Yes 18(18.67) School 2 22(18.67) School 3 16(18.67) Total 56
No
32(31.33)
28(31.33)
34(31.33)
94
Total
50
50
50
150
X 2 = (O E) 2 = 1.596 E
SOLUTION ( CONTD )
STEP 4. Make the decision. The decision is not to reject the null hypothesis, since 1 .596 < 5.991 . STEP 5. Summarize the results . There is not enough evidence to reject the null hypothesis that the proportions of high school students who drive their own or their parents cars to school are equal for each school.
SUMMARY
There are three main uses of the chi -square test: 1 . The test of independence is used to determine whether two variables are related or are independent . 2. It can be used as goodness -of-fit test, in order to determine whether the frequencies of a distribution are the same as the hypothesized frequencies. 3. The homogeneity of proportions test is used to determine if several proportions are all equal when samples are selected from dif ferent populations.
CONCLUSION
The chi-square test is useful in a variety of hypotheses tests that can be applied to many dif ferent everyday situations.
References:
h t t p : / / w w w. c o mp ut i n g . d cu .i e / ~ w uh a i / c h a p 1 1 . p d f M e l e c i o D . ( 1 9 9 6 ) . E l e m e n t a r y s t a t i s t ic s f o r b a s i c e d u c a t i o n . P h o e n i x P u b l i s h i n g H o u s e I n c . Q u e z o n C i t y. P u n s a l a n a n d U r i a r te . ( 1 9 9 4 ) . S t a t i s t i cs a s i m p l ifi e d a p p r o a c h . Rex P r i n t in g C o m p a ny, I n c . Q u e z o n C i t y.
THE END
THANK YOU