You are on page 1of 26

Statistical

Inference 2:
Hypothesis Testing
Marnielle A. Salig
TEST FOR INDEPENDENCE
CHI – SQUARE TEST
CHI – SQUARE TEST
• used as a test of significance when we have
data that are expressed in
frequencies, or
in terms of percentages (or proportions) but
which can be readily transformed into
frequencies.
• can used as
test concerning the population variance
goodness-of-fit test
test for independence
CHI – SQUARE TEST for Independence

• used to determine whether an attribute (or


characteristic) is related on another
attribute or characteristic
• is a test to establish relationship between
two variables when these variables are
measured using only frequency counts.
CHI – SQUARE TEST for Independence

Ho: Variables X and Y are independent.


(that is, there is no relationship between
the two variables)

H1: Variables X and Y are dependent. (that


is, the variables are related).
CHI – SQUARE TEST for Independence

Test Statistic

c r (o ij  eij ) 2
2 𝑣 =(𝑟 −1)(𝑐 −1)
    

j i eij

c r ( oij  eij  0.5 ) 2

 (corrected )  
2

j i eij
 𝑣 = ( 2 − 1 ) ( 2− 1 ) =1
CHI – SQUARE TEST for Independence

Critical Region

Reject Ho if
2 2
    ,v
Otherwise, Ho is not rejected.
CHI – SQUARE TEST for Independence

Computation

( RiT ) (CTj )
eij 
GT
CHI – SQUARE TEST for Independence

Conclusion

If the null hypothesis is rejected, it


implies that the two variables are
related otherwise, the two are not
related or independent.
REMARK:

In general, for a contingency table, it is


required that
• no fewer than 20% of the cells should
have an expected frequency of less
than 5
• no cell should have an expected
frequency of less than 1
A random sample of 300 persons is classified
according to age bracket and beverage preference.
Determine if a relationship exists between age and
beverage preference at the 0.025 level of
significance. The following data were given:

Beverage Teenagers Adult Senior Citizen


Coffee/Tea 22 36 54
Soft drinks 94 54 30
Others 34 10 16
 
1.: Age and beverage preference are independent.
: Age and beverage preference are dependent.
2.
3.Test Statistic:
c r (oij  eij ) 2

  
2
𝑣 =(𝑟 −1)(𝑐 −1)
 
eij
¿ ( 3−1 )(3−1 )=( 2 )( 2 ) =4
j i  

4.Critical Region: which is


Thus we reject if
Chi-square distribution table

14
5. Computation.
Beverage Teenagers Adult Senior Citizen TOTAL
Coffee/Tea 22 36 54 112 ( RiT ) (CTj )
Soft drinks 94 54 30 178 eij 
GT
Others 34 10 16 60
NOTE: T=TOTAL; GT=GRAND
TOTAL 150 100 100 350 TOTAL; i=row, j=column

( R1T ) (CT 1 ) (112)(150) ( R2T ) (CT 2 ) (178)(100) ( R3T ) (CT 3 )


e11    48 e22    50.86 e33 
GT 350 GT 350 GT
( R1T ) (CT 2 ) (112)(100) ( R2T ) (CT 3 ) (178)(100) (60)(100)
e12    32 e23    50.86   17.14
GT 350 GT 350 350
( R1T ) (CT 3 ) (112)(100) ( R3T ) (CT 1 ) (60)(150)
e13    32 e31    25.71
GT 350 GT 350
( R2T ) (CT 1 ) (178)(150) ( R3T ) (CT 2 ) (60)(100)
e21    76.29 e32  GT

350
 17.14
GT 350
Teenagers Senior
Adult Citizen Total
Coffee/Tea Observed 22 36 54 112
Expected 48 32 32
Soft drinks Observed 94 54 30 178
Expected 76.29 50.86 50.86
Others Observed 34 10 16 60
Expected 25.71 17.14 17.14
Total Observed 150 100 100 350

c r (oij  eij ) 2 (22  48) 2 (36  32) 2 (54  32) 2 (94  76.29) 2
 2       
j i eij 48 32 32 76.29
(54  50.86) 2 (30  50.86) 2 (34  25.71) 2 (10  17.14) 2 (16  17.14) 2
   
50.86 50.86 25.71 17.14 17.14
 14.08  0.5  15.125  4.11  0.19  8.556  2.673  2.97  0.08  48.29
6. Decision:
Since, 48.29 > 11.143, we reject Ho.

7. Conclusion:
Age and beverage preference are dependent.

17
We have surveyed 50 males and 100
females and asked them whether they
personally wanted to have kids. The
choices available to each person were
"yes," "no," and "undecided." Listed
here are the results of the survey.
Use alpha = 0.05
Observed Frequency
Don’t want
Gender Want Kids Undecided Row Total
Kids

Male 20 10 20 50

Female 20 20 60 100

Column 40 30 80 150

Total
Ho: There is no association between the
gender and the desire to have children
H1: There is an association between the
gender and the desire to have children

Rejection Region: (3-1)(2-1) = 2


Expected Frequency
Don’t want
Gender Want Kids Undecided Row Total
Kids

Male 13.33 10 26.67 50

Female 26.67 20 53.33 100

Column 40 30 80 150

Total
Don’t want
Gender Want Kids Undecided Row Total
Kids

Male 50
20 10 20
Observed
13.33 10 26.67
Expected

Female 100
20 20 20
Observed
26.67 20 53.33
Expected

Column Total 40 30 80 150


 
=
= + + +

= 7.51
Decision:

 
Since the calculated (7.51) is greater than the
critical value (5.99), we reject the null
hypothesis. This means that there is a significant
relationship/association between the gender and
their stated preferences for having children.
ASSIGNMENT:

We want to know whether or not gender is associated


with political party preference. We take a simple
random sample of 500 voters and survey them on
their political party preference. The following table
shows the results of the survey:
REPUBLICAN DEMOCRAT INDEPENDENT TOTAL

MALE 120 90 40 250

FEMALE 110 95 45 250

TOTAL 230 185 85 500

USE LEVEL OF SIGNIFICANCE: 0.05

You might also like