0% found this document useful (0 votes)
12 views27 pages

Chi-Squared Test Explained

The document provides an overview of statistical tests including the chi-squared test, T-test, and Z-test, detailing their purposes, procedures, and conditions for use. It includes examples of how to apply these tests to real-world data, such as analyzing accident frequencies and associations between attributes like blindness and deafness. Additionally, it emphasizes the importance of understanding the underlying assumptions and significance levels when conducting these tests.

Uploaded by

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

Chi-Squared Test Explained

The document provides an overview of statistical tests including the chi-squared test, T-test, and Z-test, detailing their purposes, procedures, and conditions for use. It includes examples of how to apply these tests to real-world data, such as analyzing accident frequencies and associations between attributes like blindness and deafness. Additionally, it emphasizes the importance of understanding the underlying assumptions and significance levels when conducting these tests.

Uploaded by

adityagrawal8770
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

RESEARCH

MODULE 4

Dr. Shivani Guru


(Assistant Professor)
Dr. Shivani Guru

• A chi-squared test (symbolically represented as χ2) is basically a data analysis


on the basis of observations of a random set of variables. Usually, it is a
comparison of two statistical data sets. This test was introduced by Karl
Pearson in 1900 for categorical data analysis and distribution. So it was
mentioned as Pearson’s chi-squared test.
• The chi-square test is used to estimate how likely the observations that are
made would be, by considering the assumption of the null hypothesis as true.
• A hypothesis is a consideration that a given condition or statement might be
true, which we can test afterwards.
Dr. Shivani Guru

• The test is, in fact, a technique through the use of which it is


possible for all researchers to
(i) test the goodness of fit;
(ii) test the significance of the association between two
attributes, and
(iii) test the homogeneity or the significance of population
variance.
Dr. Shivani Guru

Conditions for the chi-square test

• For the chi-square test to be performed, the following


conditions are to be satisfied:
[Link] observations are to be recorded and collected on a
random basis.
[Link] items in the samples should all be independent.
3. The total number of individual items in the sample should
also be reasonably large, about 50 or more.
Dr. Shivani Guru

Procedure of χ2 test
• Set up the Null hypothesis that there is no significant difference between the observed value
and expected value
• Arrange the observed values, or frequencies in a column, and denote them by O
• Find the expected values, denote them by E
• Obtain the difference between observed and expected value(O-E).
• Square up the difference between O and E, denote them by (𝑂 − 𝐸)2
(𝑂−𝐸)2
• Divide each squared difference br respective expected value(E) and denote them by
𝐸
(𝑂−𝐸)2
• Get the total of above fractions as ∑( )
𝐸
• Obtain the critical value of χ2 from the table with reference to degree of freedom and
desired level of significance (usually 5%)
• Now accept or reject the null hypothesis
Dr. Shivani Guru

• where,

• χ 2 = Chi-Square value
• Oi = Observed frequency
• Ei = Expected frequency
The number of accidents during a week in XYZ was as follows

Days Sun Mon Tue Wed Thu Fri Sat


Frequency 16 24 28 32 18 28 22

Find the calculated value of Chi square, and test the goodness of fit thereby at 5% level of
significance under the hypothesis that the accidents were uniformly distributed over the
week.

Dr. Shivani Guru


Hypothesis (H)that the accidents were uniformly distributed over the week.
Σ𝑋
The number of accidents expected per days is given by E= = 168/7 =24
𝑁

Days Observed Expected O-E (𝑂 − 𝐸)2 (𝑂 − 𝐸)2


Frequency(O) Frequency(E) 𝐸
Sun 16 24 -8 64 2.667
Mon 24 24 0 0 0.000
Tue 28 24 4 16 0.667
Wed 32 24 8 64 2.667
Thu 18 24 -6 36 1.500
Fri 28 24 4 16 0.667
Sat 22 24 -2 4 0.167
168 168 0 8.335

= 8.335
Dr. Shivani Guru
• We have degree of freedom (d.f.) v= n-1= 7-1=6
• Level of significance difference (p)= 0.05
• And the tabulated value of 𝜒 2 for =6, and p= 0.05 is 12.6
• Hence calculated value of 𝜒 2 is less than critical value 12.6. therefore
hypothesis drawn is accepted

Dr. Shivani Guru


• Two groups of 50 handicaps each were taken to study the association
of blindness with deafness, and the observations were tabulated as
under

Attributes Blind Not Blind Total


Deaf 10 40 50
Not Deaf 30 20 50
Total 40 60 100

Dr. Shivani Guru


• Null hypothesis: The attributes of blindness and deafness are independent and they are
not associated.
Step 2: Calculate the Expected Value

𝑅𝑜𝑤 𝑡𝑜𝑡𝑎𝑙 𝑋 𝐶𝑜𝑙𝑢𝑚𝑛 𝑡𝑜𝑡𝑎𝑙


Expected Value =
𝑇𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑂𝑏𝑠𝑒𝑟𝑣𝑎𝑡𝑖𝑜𝑛

Attributes Blind Not Blind Total


Deaf 50𝑋40 50𝑋60 50
=20 =30
100 100
Not Deaf 50𝑋40 50𝑋60 50
=20 =30
100 100
Total 40 60 100
Dr. Shivani Guru
Observed Expected Value O-E (𝑂 − 𝐸)2 (𝑂 − 𝐸)2
Value(O) (E) 𝐸
10 20 -10 100 5
40 30 10 100 3.33
30 20 10 100 5
20 30 -10 100 3.33
16.66

Dr. Shivani Guru


• We have degree of freedom (d.f.) v= (c-1)(r-1)= (2-1)(2-1)=1
• Level of significance difference (p)= 0.05
• And the tabulated value of 𝜒 2 for =16.66, and p= 0.05 is 3.841
• Hence calculated value of 𝜒 2 is more than critical value 3.841.
therefore hypothesis drawn is rejected.

Dr. Shivani Guru


• Suppose we want to know if gender has anything to do with political party preference.
So, we poll 420 voters in a simple random sample to find out which political party they
prefer. The results of the survey are provided in the table below.

Democrat Independent Dependent


Republican
Male 100 70 30 200
Female 140 60 20 220
Total 240 130 50 420

Observed Value

To see if gender is linked to political party preference, Perform a Chi Square test to verify the assumed theory.

Dr. Shivani Guru


• First we define the cases for different hypothesis such as,

𝐻0 = There is no link between gender and political party preference.


𝐻1 = There is a link between gender and political party preference.

• Now we calculate the expected frequency.

Dr. Shivani Guru


• Now we calculate the expected frequency.
𝑅𝑜𝑤 𝑡𝑜𝑡𝑎𝑙 𝑋 𝐶𝑜𝑙𝑢𝑚𝑛 𝑡𝑜𝑡𝑎𝑙
• Expected Value =
𝑇𝑜𝑡𝑎𝑙 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑂𝑏𝑠𝑒𝑟𝑣𝑎𝑡𝑖𝑜𝑛

Dr. Shivani Guru


T test
• T test is a statistical test that is used to compare the
mean of two groups.
• T test is a small sample test.
• It was developed by William Gosset in 1908.
• It also called students t test (pen name).
• Size of samples small (n<30)
• Degree of freedom (v= n-1)

Dr. Shivani Guru


Practice Question
• A random sample of size 20 from normal population gives sample
mean of 42 and sample standard deviation (S.D) of 6. Test the
hypothesis that population mean is 44.

• A sample of 18 graduating MBA students at a college was taken and


the information was obtained on their income. The mean monthly
starting income was found to be Rs 25500 with the standard
deviation of 760. the past data on the staring income has given a men
value of Rs 25000 using a 5% level of significance can we conclude
that the average starting incomes is different from Rs 25000?

Dr. Shivani Guru


• The mean lifetime of a sample of 25bulbs is found as 1550h with
standard deviation of 12oh. The company manufacturing the bulbs
claims the average life of their bulbs is 1600h. Is the claim acceptance
at 5% level of significance?

• The oil tins are taken at random from an automatic filling machine.
The mean weight of the tins is 15.8kg and standard deviation is 0.5
kg. does the sample mean differ significantly from the intended
weight of 16kg?

Dr. Shivani Guru


Dr. Shivani Guru

A Z-test is a type of hypothesis test used in


statistics to determine whether there is a
significant difference between sample and
population means or between the means of two
samples, under the assumption that the data are
normally distributed and the population

Z test Key Points about Z-Test:


• Used when:
• The sample size is large (usually n>30n >
30n>30).
• Population standard deviation (σ\sigmaσ)
is known.
Dr. Shivani Guru
Dr. Shivani Guru

Types of Z-Test:
[Link]-sample Z-test:
1. Compares the sample mean to a known population mean.
[Link]-sample Z-test:
1. Compares the means of two independent samples.
3.Z-test for proportions:
1. Used when testing for differences between proportions (e.g., % of
success/failure).
Dr. Shivani Guru

• Steps to Perform a Z-Test:


• State the null hypothesis 𝐻0 and alternative hypothesis 𝐻1
• Set significance level (e.g., α=0.05\alpha = 0.05α=0.05).
• Calculate the Z statistic using the appropriate formula.
• Find the critical Z value from the Z-table.
• Make a decision:
• If Z > critical value → Reject 𝐻0
• If Z ≤ critical value → Fail to reject 𝐻0
Dr. Shivani Guru

Practice Question
• Question 1: One-sample Z-test (Right-tailed)A manufacturer claims that a new machine
produces more than 500 units per day. A sample of 40 days shows a mean output of
515 units with a standard deviation of 20 units. Test the claim at 1% level of
significance.Z-tabulated value at α = 0.01 (right-tailed): 2.33

• Question 2: One-sample Z-test (Left-tailed)A pharmaceutical company claims its drug


reduces blood pressure by at least 25 units. A sample of 36 patients shows a mean
reduction of 23 units with a standard deviation of 6 units. Test the claim at 5% level of
significance.Z-tabulated value at α = 0.05 (left-tailed): –1.645
Dr. Shivani Guru

• Question 3: One-sample Z-test (Two-tailed)A light bulb manufacturer


claims the average life of its bulbs is 1200 hours. A consumer group tests
a sample of 60 bulbs and finds a mean life of 1175 hours with a standard
deviation of 90 hours. Test the claim at the 5% significance level.Z-
tabulated value at α = 0.05 (two-tailed): ±1.96
• Question 4: One-sample Z-test (Right-tailed)A student wants to test if a
new study method improves test scores. The historical mean is 70. After
applying the new method, a sample of 25 students scores an average of
75 with a standard deviation of 12. Test at the 1% level of significance.Z-
tabulated value at α = 0.01 (right-tailed): 2.33
Dr. Shivani Guru

• Question 5: One-sample Z-test (Two-tailed)An energy drink


company claims its drink increases alertness by 30 minutes on
average. A study on a sample of 49 individuals finds a mean
increase of 27 minutes with a standard deviation of 7
minutes. Test the claim at the 1% level of significance.Z-
tabulated value at α = 0.01 (two-tailed): ±2.576
• Note for better understanding refer book, if in PPT you think matter is
less read from a book or other sources.
• PPT is never sufficient material to prepare it for examinations, it only
provides you with a reference.
• Practice Chi square test, T test and Z test problem.

Dr. Shivani Guru

You might also like