Professional Documents
Culture Documents
Goodness of Fit
I The multinomial experiment :
1. The experiment consists of n identical trials.
2. The outcome of each trial falls into one of k
categories.
3. The probability that the outcome of a single trial falls
into a particular category, say category i, is pi and
remains constant from trial to trial. This probability
must be between 0 and 1, for each of the k
categories, and the sum of all k probabilities is
k
X
pi = 1 . (1)
i=1
n!
P(x = k) = pk q n−k (3)
k!(n − k )!
n!
P(x1 , x2 , ..., xk ) = px1 px2 ...pkxk (4)
x1 !x2 !...xk ! 1 2
Goodness of Fit
I Suppose we want to hypothesize values for each of the
probabilities p1 , p2 , ...,pk as
H0 : P1 = p1 , P2 = p2 , ... , Pk = pk
vs H1 : At least one of the probabilties is different
k 2
X (Oi − Ei )
X2 = (5)
Ei
i=1
Ei = npi . (6)
3 2
2
X (Oi − Ei )
Xcalc =
Ei
i=1
(O1 − E1 )2 (O2 − E2 )2 (O3 − E3 )2
= + +
E1 E2 E3
2 2
(20 − 30) (39 − 30) (31 − 30)2
= + +
30 30 30
= 6.067
2
I Reject if Xcalc > Xk2−1,α (slide 4).
I From X 2 table : Xk2−1,α = X3−1,0.05
2 2
= X2,0.05 = 5.99.
I 2
Since Xcalc 2
> X2,0.05 =⇒ 6.067 > 5.99 =⇒ H0 is
rejected.
I The hypothesis of no preference is rejected. There is sufficient
evidence to indicate that the snake has a preference for one of
the three doors.
Question of Direct Relevance to Exam
I Solution :
4 2
2
X (Oi − Ei )
Xcalc =
Ei
i=1
(O1 − E1 )2 (O2 − E2 )2 (O3 − E3 )2 (O4 − E4 )2
= + + +
E1 E2 E3 E4
(294 − 250)2 (276 − 250)2 (238 − 250)2 (192 − 250)2
= + + +
250 250 250 250
= 24.48
2
I Reject if Xcalc > Xk2−1,α (slide 4).
I From X 2 table : Xk2−1,α = X4−1,0.05
2 2
= X3,0.05 = 7.82.
I 2
Since Xcalc 2
> X3,0.05 =⇒ 24.48 > 7.82 =⇒ H is 0
rejected.
I The hypothesis of no preference is rejected.
Question of Direct Relevance to Exam
3 2
2
X (Oi − Ei ) (O1 − E1 )2 (O2 − E2 )2 (O3 − E3 )2
Xcalc = = + +
Ei E1 E2 E3
i=1
(329 − 300)2 (43 − 25)2 (128 − 175)2
= + +
300 25 175
= 28.39
2
I Reject if Xcalc > Xk2−1,α (slide 4).
I From X 2 table : Xk2−1,α = X3−1,0.05
2 2
= X2,0.05 = 5.99.
I 2
Since Xcalc 2
> X2,0.05 =⇒ 28.39 > 5.99 =⇒ H is 0
rejected.
I There is a departure from previous record rates.
Question of Direct Relevance to Exam
and
=⇒s = √
290 = 17.03
n
X
fi xmi
i=1 24680
x̄ = = = 123.4
n 200
=⇒ s 17.03
CVar = × 100% = × 100% = 13.8%
x̄ 123.4
Solution
I Frequency table
n
!
X
where Ei = npi = fi Ai and Oi = fi .
i=1
Solution
I =⇒X (O − E )
6 2
(24 − 26.7)2 (62 − 55.1)2 (72 − 66.64)2
2 i i
Xcalc = = + +
Ei 26.7 55.1 66.64
i=1
(26 − 38.96)2 (12 − 11)2 (4 − 1.6)2
+ + +
38.96 11 1.6
= 9.57.
2
I Reject if Xcalc > Xk2−1,α (slide 4).
I From X 2 table : Xk2−1,α = X6−1,0.05
2 2
= X5,0.05 = 11.07.
I 2
Since Xcalc 2
< X5,0.05 =⇒
9.57 < 11.07
=⇒ H0 is not rejected.
I The population is normally distributed.
Question of Direct Relevance to Exam
1 5.5–10.5 1 8 8 64 64
2 10.5–15.5 2 13 26 169 338
3 15.5–20.5 3 18 54 324 972
4 20.5–25.5 5 23 115 529 2645
5 25.5–30.5 4 28 112 784 3136
6 30.5–35.5 3 33 99 1089 3267
7 35.5–40.5 2 38 76 1444 2888
n
X n
X n
X
2
Sums fi = 20 fi xmi = 490 fi xm i
i=1 i=1 i=1
=13310
Solution
I Now,
n
!2
X
n
fi · xmi
X i=1
fi · xm2 i −
n
i=1
s2 =
n−1
h 2
i
490
13310 − 20 13310 − 12005
= = = 68.7
20 − 1 19
and
n
X
fi xmi
i=1 490
x̄ = = = 24.5
n 20
=⇒
s 8.3
CVar = × 100% = × 100% = 33.9%
x̄ 24.5
Solution
I Frequency table
n
!
X
where Ei = npi = fi pi and Oi = fi .
i=1
Solution
n
!
X
where Ei = npi = fi pi and Oi = fi .
=⇒X (O − E ) 7 2
i=1
2
I Reject if Xcalc > Xk2−1,α (slide 4).
I From X 2 table : Xk2−1,α = X7−1,0.05
2 2
= X6,0.05 = 12.592.
I 2
Since Xcalc 2
<< X6,0.05 =⇒ 0.1592 << 12.592 =⇒
H0 is not rejected (accepted strongly).
I The population is normally distributed.
Contingency Tables
I Suppose we want to hypothesize values for each of the
probabilities p11 , p12 , ...,pmn as
H0 : P11 = p11 , P12 = p12 , ... , Pmn = pmn
vs H1 : At least one of the probabilties is different
m X
n 2
2
X Oij − Eij
X = (7)
Eij
i=1 j=1
ri cj
Eij = . (8)
n
Hernia No Hernia
I Solution :
H0 : Gender and Hermia are Independent
vs H1 : Gender and Hernia are not Independent
Hernia No Hernia
Covid–19 24 9 13
I Solution :
H0 : Vaccine and Covid–19 are Independent
vs H1 : Vaccine reduces Covid–19 Cases
Covid–19 24 9 13 46
(14.4) (5.01) (26.59)