Sunteți pe pagina 1din 27

HYPOTHESIS TESTING

Chi
squared
test

Chi squared

test

Chi squared test is used when the


population distribution under study
has no parameters
The symbol is used
The sampling distribution is called
distribution
The statistic is compared with its
critical value

ASSUMPTIONS
1. The experiment consists of n categories
but independent trials. The outcome of
each trial falls into each of k categories. The
observed number in each category written
as O1,O2,On
2. If there are only 2 cells the expected
frequency in each cell should be 5 or more
3. For more than two cells, if more than 20
% of cells have expected frequencies less
than 5 then should not be applied

ASSUMPTIONS
4.Samples must be drawn randomly
from population on interest
5. The sample should contain at least
50 observations
6. The data should be expressed in
original units rather than in
percentage or ratio

Chi squared
statistic

test

= (O-E) / E
O = an observed frequency in particular
category
E = expected frequency in particular category
Decision rule
The calculated value of test statistic is
compared at particular level of significance and
degree of freedom
If cal > critical then null hypothesis is
rejected in favor of alternate hypothesis
The degree of freedom for test statistic
depends on the test and certain other factors

APPLICATIONS OF TEST
A few important applications of are
1. Test of Independence
2. Test of goodness of fit
3. Yales correction for continuity
4. Test for population variance
5. Test for Homogeneity

Contingency Table Analysis : test


of Independence
The test of independence is used
to analyze the frequency of two
qualitative variables or attributes
with multiple categories to determine
whether the two variables are
independent
The test of independence can be
used to analyze any level of
measurement, but it is particularly
useful in analyzing nominal data

Contingency Table Analysis : test


of Independence
For e.g.,
Whether voters can be classified by
gender is independent of the political
affiliation
Whether university students
classified by gender are independent
of courses of study
Whether wage earners classified by
education level are independent of
income

Contingency Table Analysis : test


of Independence
Contingency Table When
observations (frequencies) are
classified according to two
qualitative variables or attributes
and arranged in a table the display is
called a contingency table

Contingency Table Analysis : test


of Independence
Variabl
eA

A1

A2

Ac

Total

.
Variabl
eB
B1

O11

O12

O1c

R1

B2

O21

O22

O2c

R2

..

..

Or1

Orc
Rr
Br
The value
Oij is Or2
the observed
frequency
for
Total
N
the cell C1
in row I C2
and column j Cc
The total sum rows and columns are sum
of the frequencies in respective rows and
columns.
N is total of frequencies

Contingency Table Analysis :


test of Independence
Eij
Row i total
x column j total x
=
grand total
Sample size
sample size
= Ri x
Cj =x N
R i x Cj
N
N
N

Contingency Table Analysis : test


of Independence
The analysis of two way contingency
table helps to answer the question
whether the two variable are
unrelated or independent of each
other
The null hypothesis for a test of
Independence is that two variables
are independent

Procedure
Step 1 State null hypothesis and
alternate hypothesis
Ho : The variables are independent.
No relationship exists
H1: A relationship exists
Step 2 Select a random sample and record
observed frequencies (O values)in each
cell of contingency table
Calculate row, column and grand total

Procedure
Step 3 calculate the expected
frequencies (E values)for each cell
E = (row total x column total) / grand total
Step 4 Compute the value of test statistic

(O-E) / E

Step 5 Calculate the degrees of freedom.


The degree of freedom for the test of
independence
df=(number of rows -1)(number of
columns -1)
= (r-1)(c-1)

Procedure
Step 6 Using a level of
significance and df find the
critical value of . This value of
corresponds to an area in right tail
of the distribution
Step 7 -Compare the calculated and
table value of
Decision rule
Accept Ho if cal is less than table
value (r-1)(c-1)

EXAMPLE 1
Two hundred randomly selected
adults were asked whether TV shows
as a whole are primarily
entertaining , educational or a waste
of time (only one answer to be
Opinion
chosen). The respondents
were
Gender
Entertain Educatio Waste of Total
categorized
Opinions
are
ing as gender.
nal
time
asFemale 52
28
30
110
Male

28

12

50

90

Total

80

40

80

200

EXAMPLE 1
Is this convincing that there is a
relationship between gender and
opinion in the population interest
The critical value of =5.99at
=0.05 and df=2

EXAMPLE 1 -Solution
Let us assume the null hypothesis
that the opinion of adults is
independent of gender
The contingency table is of size
2x3, the degree of freedom is (2-1)
(3-1)=2. Therefore we would have
to calculate only two expected
frequencies and other four can be
automatically determined

EXAMPLE 1 -Solution
E11 = row 1 total x column 1
total /grand total
= 110 x 80/200 = 44
E22 = row1 total x column 2
total/grand total
=110 x 40/200 = 22
E13 = 110-(44+22) = 44
E21 = 80-E11 = 80-44 = 36
E22 = 40-E12 = 40-22 =18

EXAMPLE 1 -Solution
The contingency table of expected
frequencies is as follows
Gender Entertain Education Waste
ing
al
of time

Total

Female 52
Male
28
Total
80

110
90
200

28
12
40

30
50
80

EXAMPLE 1 -Solution
Observ
ed (O)
52
28
30
28
12
50

Expected (O-E)
(E)

(O-E) (OE)/E

EXAMPLE 1 -Solution
Observ
ed (O)

Expected (O-E)
(E)

52
28
30
28
12
50

44
22
44
36
18
36

(O-E) (OE)/E

EXAMPLE 1 -Solution
Observ
ed (O)

Expected (O-E)
(E)

52
28
30
28
12
50

44
22
44
36
18
36

8
6
14
-8
-6
14

(O-E) (OE)/E

EXAMPLE 1 -Solution
Observ
ed (O)

Expected (O-E)
(E)

(O-E) (OE)/E

52
28
30
28
12
50

44
22
44
36
18
36

64
36
196
64
36
196

8
6
14
-8
-6
14

EXAMPLE 1 -Solution
Observ
ed (O)

Expected (O-E)
(E)

(O-E) (OE)/E

52
28
30
28
12
50

44
22
44
36
18
36

64
36
196
64
36
196

8
6
14
-8
-6
14

1.454
1.636
4.455
1.777
2.000
5.444
16.766

EXAMPLE 1 -Solution
The critical value of =5.99 at
=0.05 and df=2. Since the
calculated value of =16.777 is
more than its critical value , the
null hypothesis is rejected. Hence
we conclude that the opinion of
adults is not independent of gender

S-ar putea să vă placă și