Week 5
Week 5
Week 5
Chi-square tests
1. Chi-square test of Association
2× 𝟐 Contingency Table
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
𝒉 × 𝒌 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.
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
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
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, …
The rth moment about the mean of a random variable 𝑋 denoted by 𝝁𝒓 is the expected value of
(𝑋 − 𝜇) ; i.e.𝑬[(𝑿 − 𝝁)𝒓 ].
𝐹𝑜𝑟 𝑟 = 1,2,3, …
Theorem:
Proof:
36
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 (𝑡).
𝑑 𝑀 (𝑡)
𝑎𝑛𝑑, 𝑀 (𝑡) =
𝑑𝑡
1. 𝑀 (𝑡)| = 𝐸(𝑋)= 𝜇
2. 𝑀 (𝑡)| = 𝐸(𝑋 )
3. 𝑉(𝑋) = 𝑀 (𝑡)| − (𝑀 (𝑡)| )
37
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.