Professional Documents
Culture Documents
Lec 31
Lec 31
Department of Mathematics
National Institute of Technology Calicut
The test of goodness of fit is used to find out how the observed
value of a given phenomena is significantly different from the
expected value.
In Chi-square goodness of fit test, the term goodness of fit is
used to compare the observed sample distribution with the
expected probability distribution.
In other words, these tests show well the distribution you
selected fits to your data.
For example:
Consider the tossing of a die.
We hypothesize that the die is honest, which is equivalent to
testing the hypothesis that the distribution of outcomes is the
discrete uniform distribution
f (x) = 1/6, x = 1, 2, . . . , 6.
Suppose that the die is tossed 120 times and each outcome is
recorded.
Theoretically, if the die is balanced, we would expect each face
to occur 20 times.
The results are as follows:
Face : 1 2 3 4 5 6
Observed 20 22 17 18 19 24
Expected 20 20 20 20 20 20
4 2023-11-3, 13.17 Vibhuti Arora LS: 31
LS: 31
The Chi-squared test for Goodness of Fit
n
X n
X
oi = ei
i=1 i=1
5 2023-11-3, 13.17 Vibhuti Arora LS: 31
LS: 31
The Chi-squared test for Goodness of Fit
Decision rule:
Accept H0 if χ2 ≤ χ2α,n−1 and reject H0 if χ2 > χ2α,n−1 where χ2 is the
calculated value of chi-square obtained on using (1) and χ2α,n−1 is the
tabulated value at α level of significance.
Example:
The demand for a particular spare part in a factory was found to vary
from day-to-day. In a sample study the following information was
obtained:
Test the hypothesis that the number of parts demanded does not
depend on the day of the week. (Given: the value of chi-square
significance at 5, 6, 7, d.f. are respectively 11.07, 12.59, 14.07 at the
5% level of significance).
Sol.
Here we set up the null hypothesis, H0 that the number of parts demanded
does not depend on the day of week.
Under the null hypothesis, the expected frequencies of the spare part
demanded on each of the six days would be:
P6 (oi − ei )2
χ2 = i=1 = 0.179
ei
degree of freedom is 5.
χ20.05,5 = 11.07.
0.179 = χ2 ≤ χ20.05,5 = 11.07, the null hypothesis accepted at 5% level of
significance.
Hence the number of parts demanded are same over the 6 day period.
P-value
P-value
Computing p-value
Example
Commonly prescribed drug for relieving nervous tension is believed to be 60%
effective. Experimental results with a new drug administered to a random
sample of 100 adults who were suffering from nervous tension show that 70
received relief. Is this a sufficient evidence to warrant that the new drug is
superior to the one commonly prescribed? Use a 0.05 level of significance.
Hint:
P-value is
P{|Z| > .559} = 2P{Z > .559} = 2P{Z < −.559} = 2×.288 = .576
α = 0.05
The null hypothesis accepted as α = 0.05 < .576.
H1 : µ 6= µ0
p-value is 2P{Z ≥ |TS|}
H1 : µ > µ 0
p-value is P{Z ≥ TS}
H1 : µ < µ 0
p-value is P{Z ≤ TS}
H1 : µ 6= µ0
p-value is 2P{Tn−1 ≥ |TS|}
H1 : µ > µ 0
p-value is P{Tn−1 ≥ TS}
H1 : µ < µ 0
p-value is P{Tn−1 ≤ TS}
Example
– End –