1 - CA51018 - Chi Square - Introduction - Goodness of Fit Test - 2
1 - CA51018 - Chi Square - Introduction - Goodness of Fit Test - 2
x test
↳
always positive answer
The Chi-square Distribution
The Chi-square distribution is a continuous probability distribution. It
is the distribution of a sum of the squares of k independent standard
normal random variables.
In the Chi-square distribution, as the degrees of freedom increases,
the Chi-square distribution approaches a normal distribution.
https://tophat.com/marketplace/science-&-math/statistics/full-course/statistics-for-social-science-stephen-hayward/211/34398/
Characteristics of a Chi-square Distribution:
1. The chi-square distribution is a family of curves based on
the degrees of freedom.
2. The chi-square distributions are positively skewed.
3. All chi-square values are greater than or equal to zero.
4. The total area under each chi-square distribution is equal to
one.
https://tophat.com/marketplace/science-&-math/statistics/full-course/statistics-for-social-science-stephen-
hayward/211/34398/
The Chi-square Distribution can be used to
•find a confidence interval for a variance or standard deviation;
•test a hypothesis about a single variance or standard deviation;
•test concerning frequency distributions;
•test the goodness-of-fit test;
•test for independence of two categorical variables;
•test the homogeneity of proportions;
•test the normality of the variable.
A chi-square test,
●can also be used to test the homogeneity of proportions.
● this is used to determine whether the proportions for a variable are
equal when several samples are selected from different populations.
●this also use the chi-square distribution and the contingency table.
For example,
•You would like to see if the proportions of each group of students who
play online gaming are equal based on their program of affiliation, say
proportions of accountancy students, engineering students, and
architecture students who play online gaming.
•You may want to see if the proportions of employees who are in to
stock market are equal based on the nature of their profession (IT,
Medicine, Accounting, Engineering).
Two main types of Chi-square Tests to be discussed
here are:
•Goodness-of-fit tests which focus on one categorical
variable.
•Tests of independence which focus on the relationship
between two categorical variables. Thus, the
contingency table (or cross tabulation table will be used
to present the data values).
https://tophat.com/marketplace/science-&-math/statistics/full-course/statistics-for-social-science-stephen-
hayward/211/34398/
To illustrate the use of chi-square test:
If, according to Mendel's laws, you expect 10 of 20 offspring to be male
and the actual observed number was 8 males, then you might want to
know about the "goodness-of-fit" between the observed and expected
data.
Were the deviations (differences between observed and expected value)
the result of chance, or were they due to other factors?
How much deviation can occur before we conclude that something other
than chance is at work, causing the observed to differ from the expected
value.
The chi-square test is always testing what scientists call the null
hypothesis, which states that there is no significant difference between the
expected and observed result.
Elementary Statistics by Bluman
Test for Goodness-of-Fit
Definition:
The chi-square goodness-of-fit test is used to test the claim
that an observed frequency distribution fits some given
expected frequency distribution.
The observed frequencies will almost always differ from the expected frequencies due to
sampling error; that is, the values differ from sample to sample. But the question is: Are these
differences significant? (Which means, there is a difference in the life span of the batteries for
each category) or will it be due to chance only? Thus, the two opposing statements are necessary
before computing the test value, the null and alternative hypotheses. Here, the null hypothesis
indicates that there is no difference or change among the categories.
Ho: There is no difference in the life span of laptop batteries among three categories.
H1: There is difference in the life span of laptop batteries among three categories.
Summary Procedures in conducting Chi-Squared Goodness-of-Fit Test:
Observed
12 19 14
frequency
Note that this problem involves only one categorical variable, the life span of laptop batteries classified into
three (4 years and below, more than 4 years and below 10 years, above 10 years), so we use the
goodness-of-fit-test.
Solution:
Step 1: State the hypotheses and identify the claim.
Ho: The ages of laptop batteries are equally distributed over the three
categories. (claim)
(Which is the same as saying that, “There is no difference in the
lifespan of laptop batteries in the three categories.”)
H1: The ages of laptop batteries are NOT equally distributed.
(Which is the same as saying that, “There is difference in the lifespan
of laptop batteries in the three categories.”)
Step 2: Find the critical value. At α = 0.05 and df = 3-1 = 2, locate the
critical value from the chi-square table. Thus, the critical value is
5.991.
Step 3: Compute the test value
To compute the test value, we solve first for the expected value E.
Expected frequency 15 15 15
Step 4: Make the decision. Do not reject the null hypothesis, since the test value
1.73 is less than the critical value 5.991 (1.73 < 5.991)
Step 5: Summarize the results. There is not enough evidence to reject the claim
that the ages of laptop batteries is equally distributed over the three categories.
The life span of laptop batteries is equally distributed.
To illustrate the goodness-of-fit test, let us analyze the charts showing the graphs of the
observed values and the expected values of different data sets. From the charts below, you
could see whether the observed values and the expected values are close together or far
apart.
(A (B) (C)
)
From (A), the observed values From (B), the observed values From (C), the observed values
and the expected values are and the expected values are far and the expected values are far
close together, indicating that apart, the chi-square test will be apart, the chi-square test will be
the chi-square test will be small. large. Then “the null hypothesis large. Then “the null hypothesis
The decision will be “do not will be rejected”, hence, there is will be rejected”, hence, there is
reject the null hypothesis”, “not a good fit”. “not a good fit”.
hence, there is “a good fit”.
Note that this problem involves only one categorical variable, the types of investment classified into four
(stocks, mutual funds, bonds, index funds), so we use the goodness-of-fit-test.
Solution:
Step 1: State the hypotheses and identify the claim.
Ho: Investors show no preferences.
(Which is the same as saying that, “There is no difference in the
preferences on the type of investment among investors.”)
H1: Investors show preferences. (claim)
(Which is the same as saying that, “There is difference in the
preferences on the type of investment among investors.”)
Step 2: Find the critical value. At α = 0.10 and df = 4-1 = 3, locate the
critical value from the chi-square table. Thus, the critical value is
6.251.
Step 3: Compute the test value
Types of Investment Observed Frequency Expected Frequency
Stocks 35 24
Mutual Funds 18 24
Bonds 30 24
Index Funds 10 24
To compute the test value, we solve first for the expected value E.
Step 4: Make the decision. Reject the null hypothesis, since the test value 16.21 is
greater than the critical value 6.251 (16.21 > 6.251).
Step 5: Summarize the results. There is enough evidence to reject the null
hypothesis that the investors show no preferences. The investors in fact show
preferences.
Example 3:
An article shows statistics of orders made online on a particular
product with different online stores within city. The data is based
proportions,
on the last six months of the previous year as follows, July 17%, Number of Orders made
August 11%, September 8%, October 14%, November 27%, and Months with CECT store
December 23%. The CECT online store manager wants to July 30
compare the orders made with his store with that of the data August 17
revealed by the article. The manager listed the number of orders
September 22
in his store on the same product stated in the article. The table on
the right shows the data collected by the manager for the last six October 45
months in the previous year. November 30
At 0.01 level of significance, can we support the claim that the December 59
proportions of orders with CECT online store is the same as the
rest of the online stores within city?
Note that this problem involves only one categorical variable, months covered in a year, so we use the
goodness-of-fit-test.
Solution:
Step 1: State the hypotheses and identify the claim.
Ho: The orders made on a particular product in different online stores within
the city for the last six months of the year is distributed as follows: July 17%,
August 11%, September 8%, October 14%, November 27%, and December
23%.
(or “There is no difference between the orders made with the CECT online
stores with the rest of the online stores within the city”.(claim)
H1: The distribution is not the same as stated in the null hypothesis.
(or “There is difference between the orders made with the CECT online
stores with the rest of the online stores within the city”.)
Step 2: Find the critical value. At α = 0.01 and df = 6-1 = 5, locate the
critical value from the chi-square table. Thus, the critical value is 15.086.
Step 3: Compute the test value
Months Number of Orders made with CECT store (O) P E = np
Step 4: Make the decision. Reject the null hypothesis, since the test value 29.49 is greater
than the critical value 15.086 (29.49 > 15.086).
α = 0.01
15.086
Step 5: Summarize the results. There is enough evidence to reject the null hypothesis that
there is no difference between the orders made with the CECT online stores with the rest
of the online stores. The store manager would conclude that the orders on the same
product made with CECT online store is different from orders made with the other online
stores within the city.
Exercise 1: