Week 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

32

MA 3014 – S3 (’20 Batch) - 2022

Chi-square tests
1. Chi-square test of Association

2× 𝟐 Contingency Table

The outcome of a certain IQ test is tabularized as follows.

Pass Fail Total

Male O=28 E= O=12 E= 40

Female O=34 E= O=26 E= 60

Total 62 38

The two variables here are “Gender of Candidate” and “Results of the Candidate”.

When you have two categorical variables from the same population, you may test whether there
is a significant association between the two variables using the Chi-square Test.

Hypothesis

𝐻 ∶ 𝑇ℎ𝑒𝑟𝑒 𝑖𝑠 𝑛𝑜 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛𝑠ℎ𝑖𝑝 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑔𝑒𝑛𝑑𝑒𝑟 𝑎𝑛𝑑 𝑟𝑒𝑠𝑢𝑙𝑡𝑠

𝐻 ∶ 𝑇ℎ𝑒𝑟𝑒 𝑖𝑠 𝑎 𝑠𝑖𝑔𝑛𝑖𝑓𝑖𝑐𝑎𝑛𝑡 𝑟𝑒𝑙𝑎𝑡𝑖𝑜𝑛𝑠ℎ𝑖𝑝 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑔𝑒𝑛𝑑𝑒𝑟 𝑎𝑛𝑑 𝑟𝑒𝑠𝑢𝑙𝑡𝑠

Test Statistic

(𝑂 − 𝐸 )
𝜒 = ~ 𝜒 , % ; 𝑑𝑓 = (𝑟 − 1)(𝑐 − 1)
𝐸
Under H
×
Expected frequency =

𝜒 =

𝜒 , % = 3.84

Decision
33

MA 3014 – S3 (’20 Batch) - 2022

𝒉 × 𝒌 Contingency Table

Example: A survey of 200 families, known to the regular television viewers was undertaken.
They were asked which of the TV channels they watched most during a common week, and the
observations are as follows.

TV channel Region
watched most
North East South West

1 19 16 42 23

2 6 11 26 7

3 15 3 12 10

Test the hypothesis that there is no association between the TV channel watched most and the
Region, using the Chi-square test.

2. Chi-square Goodness of Fit test

Example 1

From a list of 500 digits the occurrence of each distinct digit is observed. Test at 5% significance
level, whether the sequence is a random sample from the Uniform distribution.

Digit 0 1 2 3 4 5 6 7 8 9

Frequency 40 58 49 53 38 56 61 53 60 32
34

MA 3014 – S3 (’20 Batch) - 2022

Example 2

The table below gives the number of heavy rainstorms reported by 330 weather stations over a
one year period.
a) Find the expected frequencies of rainstorms given by the Poisson distribution having the
same mean and the total as the observed distribution.

b) Use the Chi-square test to check the adequacy of the Poisson distribution to model these
data.

# rainstorms 0 1 2 3 4 5 More
than 5

# weather stations 102 114 74 28 10 2 0


35

MA 3014 – S3 (’20 Batch) - 2022

Moments and Moment Generating Function


Moments

In Statistics, the mathematical expectation is called the moments of the distribution of a


random variable.

Definition(rth moment of ar.v.)

The rth moment of a random variable 𝑋 denoted by 𝝁𝒓 is the expected value of the random
variable’s rth power; i.e.𝑬(𝑿𝒓 ).

𝐹𝑜𝑟 𝑟 = 1,2,3, …

𝜇 = 𝐸(𝑋 )= ∑ 𝑥 𝑃(𝑥) ; when 𝑋 is discrete



𝜇 = 𝐸(𝑋 )= ∫ ∝
𝑥 𝑓(𝑥)𝑑𝑥 ; when 𝑋 is continuous

Special Application: 𝝁𝟏 = 𝑬(𝑿𝟏 ) = 𝑬(𝑿) = 𝝁 (mean of r.v. X)

Definition (rth moment about the mean of ar.v.)

The rth moment about the mean of a random variable 𝑋 denoted by 𝝁𝒓 is the expected value of
(𝑋 − 𝜇) ; i.e.𝑬[(𝑿 − 𝝁)𝒓 ].

𝐹𝑜𝑟 𝑟 = 1,2,3, …

𝜇 = 𝐸[(𝑋 − 𝜇) ]= ∑(𝑥 − 𝜇) 𝑃(𝑥) ; when 𝑋 is discrete



𝜇 = 𝐸[(𝑋 − 𝜇) ]= ∫ ∝
(𝑥 − 𝜇) 𝑓(𝑥)𝑑𝑥 ; when 𝑋 is continuous

Special Application: 𝝁𝟐 = 𝑬[(𝑿 − 𝝁)𝟐 ] = V(𝑿) = 𝝈𝟐 (variance of r.v. X)

Theorem:

𝝈𝟐 = 𝝁𝟐 − 𝝁𝟐 ; i.e. 𝑽(𝑿) = 𝑬(𝑿𝟐 ) − [𝑬(𝑿)]𝟐

Proof:
36

MA 3014 – S3 (’20 Batch) - 2022

Moment Generating Function (MGF)

 The moments of most distributions can be determined directly by evaluating the respective
integrals or sums.
 MGF is an alternative procedure, which sometimes provides considerable simplifications to
find the moments.
 MGF can be used to find the expected value of ar.v. and its variance.

Definition

𝑀 (𝑡)is the value which the function 𝑀 assumes for the real variable (𝑡).

The MGF of ar.v. X is given by;

𝑀 (𝑡) = 𝐸(𝑒 ) = ∑ 𝑒 𝑃(𝑥); when𝑋 is discrete



𝑀 (𝑡) = 𝐸(𝑒 ) = ∫ ∝
𝑒 𝑓(𝑥)𝑑𝑥; when𝑋 is continuous

(𝑡𝑥) (𝑡𝑥) (𝑡𝑥)


𝑤ℎ𝑒𝑟𝑒, 𝑀 (𝑡) = 𝐸(𝑒 ) = 𝐸[1 + 𝑡𝑥 + + + ⋯+ +⋯
2! 3! 𝑟!
𝑡 𝐸(𝑥 ) 𝑡 𝐸(𝑥 ) 𝑡 𝐸(𝑥 )
𝑀 (𝑡) = 𝐸(𝑒 ) = 1 + 𝑡𝐸(𝑥) + + + ⋯+ +⋯
2! 3! 𝑟!

𝑑 𝑀 (𝑡)
𝑎𝑛𝑑, 𝑀 (𝑡) =
𝑑𝑡

𝑑 𝐸(𝑒 ) 2𝑡 𝐸(𝑥 ) 3𝑡 𝐸(𝑥 ) 𝑟𝑡 𝐸(𝑥 )


= = 0 + 𝐸(𝑥) + + + ⋯+ +⋯
𝑑𝑡 2! 3! 𝑟!
𝑑 𝑀 (𝑡)
𝑀 (𝑡) =
𝑑𝑡

𝑑 𝐸(𝑒 ) 2𝐸(𝑥 ) 6𝑡 𝐸(𝑥 ) 𝑟(𝑟 − 1_𝑡 𝐸(𝑥 )


= =0+0+ + + ⋯+ +⋯
𝑑𝑡 2! 3! 𝑟!
Properties of the MGF

1. 𝑀 (𝑡)| = 𝐸(𝑋)= 𝜇
2. 𝑀 (𝑡)| = 𝐸(𝑋 )
3. 𝑉(𝑋) = 𝑀 (𝑡)| − (𝑀 (𝑡)| )
37

MA 3014 – S3 (’20 Batch) - 2022

Example 1

Find the MGF and E(X) and V(X) for the r.v.X whose pdf is given by

𝑒 , 𝑓𝑜𝑟 𝑥 > 0
𝑓(𝑥) =
0, 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒

Example 2

Suppose Y~ Bin (n,p). Find E(X) and V(X) using its MGF.

Exercises

1. Let Y be a continuous r.v with pdff(y)=2e-3y; y≥ 0, Find the mean and the variance of Y.
2. Given that the probability distribution of a r.v. is 1/8 𝐶 for r=1,2,3. Find the MGF, mean
and variance for this random variable.

You might also like