0% found this document useful (0 votes)
39 views18 pages

Lecture 08 Test For Independence

Uploaded by

jabeenmaham04
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)
39 views18 pages

Lecture 08 Test For Independence

Uploaded by

jabeenmaham04
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
You are on page 1/ 18

PD-407

BIOSTATISTICS
TEST OF HYPOTHESIS
Lecture # 08
BY,
DR. SADIA IQBAL
PHARM-D, M.PHIL
Dated: 4th, 8th June 2024 (E)
LECTURER (PHARMACEUTICAL CHEMISTRY)
6th, 8th June 2024 (M) DCOP-DUHS
Test For Independence
LEARNING OBJECTIVES
At the end of lecture students will be able to understand
❑ Test For Independenec
❑ Exercise
❑ Chi-square Test( χ2 ):

o The chi-square (χ2 ) test is used to determine whether there


is a significant difference between the expected frequencies
and the observed frequencies in one or more categories.

o Statistical method to test whether two (or more) variables


are: (1) independent or (2) homogeneous.
❑ CONTINGENCY TABLE:

a table showing the distribution of one variable in rows and another


in columns, used to study the correlation between the two variables.
When two or more characteristics are observe for each sample element, the
data can be simultaneously classified with respect to the level of occurrences
of each of these characteristics e.g., a sample of employed persons may be
classified according to qualification and type of designation of jobs. Frequency
data which arise from cross classification on the basis of more than one
characteristics are called CONTINGENCY TABLE or CROSSTAB.
r x c CONTINGENCY TABLE:
Let the two characteristics to be studied and designated by A and B. Suppose
that there are ‘r’ categories A1, A2, A3,----------------Ar for A and ‘c’ categories B1,
B2, B3,-----------------Bc for B. By arranging the A categories in rows and the B
categories in column we can create a two way frequency table in which each
cell is at the intersection of an A category and a B category. A random sample
of ‘N’ elements classified into these cells produce a two way frequency table
called an r x c CONTINGENCY TABLE.
r x c CONTINGENCY TABLE
A B Total
B1, B2, B3, ----------------------------------------Br

A1 O11, O12, O13, -------------------------------------O1c R1


A2 O21, O22, O23, -------------------------------------O2c R2
A3 O31, O32, O33, -------------------------------------O3c R3
. . .
. . .
. . .
. . .
. . .
. . .
Ar Or1, Or2, Or3, ---------------------------------------Orc Rr

Total C1, C2, C3, ----------------------------------------- Cc N

Ri is the total of ith rows


Cj is the total of jth columns
N is the grand total
2 x 2 CONTINGENCY TABLE:
In 2 x 2 contingency table where we have only 1 degree of freedom, a correction
called YATE’S CORRECTION for continuity is applied. The corrected formula for χ2
is :
χ2corr = i=1rΣ j=1cΣ (ǀoij-eijǀ - 0.5)2 /eij
If the expected frequencies are large, the corrected and the uncorrected
results are almost the same. When the expected frequencies are between 5
and 10 Yate’s correction should be applied.
Total
a b a+b

c d c+d

Total a+c b+d a+b+c+d


❑ Steps involved in testing of hypothesis
for INDEPENDENCE:

• 1st step: State Null (H0):


o H0 : Two characteristics or two criteria of classification

are independent.
• 2nd step: State Alternative Hypothesis (HA):
o HA : Two characteristics or two criteria of classification

are not independent.

• 3rd step: State the significance level (α):


Continued….
Continued….
• 4th step: Experimental Specifications:

o test statistic:
χ2 = i=1rΣ j=1cΣ (oij-eij)2 /eij
eij = RiCj /N, e11 = R1C1 / N, e12 = R1C2 /N

oij = observed self frequencies


eij = expected self frequencies
Critical region

o Critical region:
Χ2 > Χ2α,ν ν = (r-1) (c-1)

Χ2α,ν
• 5th step: Final statement of conclusion
Critical values
of the Chi
square
Distribution
Problem# 01:
▪The following table shows that the results of an
experiment to investigate the effect of vaccination of lab animals
against a particular disease, test the hypothesis that there is no significant
difference between the vaccinated and unvaccinated group.

Got disease Didn’t get TOTAL


disease
Vaccinated 9 42 51
Not 17 28 45
vaccinated
Total 26 70 96
Got Didn’t get TOTAL
eij = RiCj /N
disease disease
Vaccinate 9 42 51
e11 = R1C1 / N d
= 51 x 26/ 96 Not 17 28 45
= 13.8125 vaccinate
d
e12 = R1C2 /N
Total 26 70 96
= 51 x 70/ 96
= 37.1875 ν = (r-1)(c-1)

e21 = R2C1 / N e22 = R2C2 / N If χ2 > χ2α,ν with ν = (r-1)(c-1), reject the
= 45 x 70/ 96 null hypothesis of independence at the α
= 45 x 26/ 96
= 32.8125 level of significance, otherwise accept the
= 12.1875 null hypothesis
Got disease Didn’t get disease TOTAL
Vaccinated 9 42 51
13.8128 37.187
Not vaccinated 17 28 45
12.187 32.81
Total 26 70 96

a) Ho : Vaccination and disease are independent


HA : Vaccination and disease are not independent
b) Data:
N = 96
α = 0.05
c) Test statistic:
χ2 = r c
i=1 Σ j=1 Σ (oij-eij)2 /eij
eij = RiCj /N, e11 = R1C1 / N, e12 = R1C2 /N
χ2 = (9-13.8128)2 + (42-37.187)2 + (17-12.187)2 + (28-32.81)2
13.8128 37.187 12.187 32.81
χ2 = 1.676926 + 0.62293 + 1.90079 + 0.70515
χ2 = 4.9057
4.9057
d) Critical region:
χ2 > χ2α,ν
χ2 > χ20.05,1
χ2 > 3.841
3.841
e) Conclusion:
Calculated value of χ2 lies in the rejected region so we reject null hypothesis and
conclude that vaccination and disease are not independent OR there is a difference
between the vaccinated and not vaccinated group.
Problem# 02:
▪Question# 12 on page 343 of book “Introduction to Statistics” by Ronald E. Walpole,
3rd edition.
In an experiment to study the dependence of hypertension on smoking habits, the
following data were taken on 180 individuals:
Nonsmokers Moderate Smokers Heavy Smokers

Hypertension 21 36 30

No Hypertension 48 26 19

Test the hypothesis that the presence or absence of hypertension is independent of


smoking habits. Use a 0.05 level of significance.

Conclusion: Calculated value of χ2 lies in the rejected region so we reject null


hypothesis and conclude that hypertension and smoking habits are not independent.
Problem# 03:
▪Question# 13 on page 343 of book “Introduction to Statistics” by Ronald E. Walpole,
3rd edition.
A random sample of 200 married men, all retired, were classified according to
education and number of children.
Education Number of Children
0-1 2-3 Over 3
Elementary 14 37 32
Secondary 19 42 17
College 12 17 10
Test the hypothesis, at the 0.05 level of significance, that the size of a family is
independent of the level of education attained by the father.
Conclusion:
Calculated value of χ2 lies in the accepted region so we accept null hypothesis and conclude
that the size of a family is independent of the level of education attained by father.
Problem# 04:
▪Question# 14 on page 343 of book “Introduction to Statistics” by Ronald E. Walpole,
3rd edition.
A random sample of 30 adults are classified according to gender and the number of
hours they watch television during a week.
Male Female

Over 25 hours 5 9
Under 25 hours 9 7
Using a 0.01 level of significance, test the hypothesis that a person’s gender and time
watching television are independent.

Conclusion:
Calculated value of χ2 lies in the accepted region so we accept null hypothesis and
conclude that Person’s gender and time watching television are independent.
Problem# 05:
▪Question# 15 on page 344 of book “Introduction to Statistics” by Ronald E. Walpole,
3rd edition.
A random sample of 400 college students are classified according to class status and
drinking habits.
Freshman Sophomore Junior Senior

Heavy Drinkers 29 41 33 28
Moderate Drinkers 32 29 36 39
Nondrinkers 55 34 27 17
Test the hypothesis that class status and drinking habits are independent. Use a 0.05
level of significance.

Conclusion:
Calculated value of χ2 lies in the rejected region so we reject null hypothesis and conclude
that the class status and drinking habits are not independent.

You might also like