Module 3 (Part-II)
Module 3 (Part-II)
S. Devi Yamini
1 Introduction
1 Introduction
1 Introduction
3 Chi-square Test
Test for Independence
Test for goodness of fit
1 Introduction
3 Chi-square Test
Test for Independence
Test for goodness of fit
4 Design of Experiments
One-way ANOVA
Two-way ANOVA
Student’s t-distribution
The p.d.f of the t-distribution is
Γ( (r +2 1) ) 1
f (t ) = √ r
π r Γ( 2 ) (1 + t 2 ) (r +2 1)
r
Null Hyp H0 : µ = µ0
Null Hyp H0 : µ = µ0
Test statistic :
x̄ − µ
t =
√S
n
Here,
(xi − x̄ )2
P
2
S =
n −1
is an unbiased estimator of population standard deviation σ 2 .
Here,
(xi − x̄ )2
P
2
S =
n −1
is an unbiased estimator of population standard deviation σ 2 .
The relation between S and s (sample standard deviation) is
r
n
S = s( )
n −1
Here,
(xi − x̄ )2
P
2
S =
n −1
is an unbiased estimator of population standard deviation σ 2 .
The relation between S and s (sample standard deviation) is
r
n
S = s( )
n −1
S S
(x̄ − t α ,n −1 √ , x̄ + t α ,n −1 √ )
2 n 2 n
Tables T-11
•
TABLE D
t distribution critical values
Upper-tail probability p
df .25 .20 .15 .10 .05 .025 .02 .01 .005 .0025 .001 .0005
1 1.000 1.376 1.963 3.078 6.314 12.71 15.89 31.82 63.66 127.3 318.3 636.6
2 0.816 1.061 1.386 1.886 2.920 4.303 4.849 6.965 9.925 14.09 22.33 31.60
3 0.765 0.978 1.250 1.638 2.353 3.182 3.482 4.541 5.841 7.453 10.21 12.92
4 0.741 0.941 1.190 1.533 2.132 2.776 2.999 3.747 4.604 5.598 7.173 8.610
5 0.727 0.920 1.156 1.476 2.015 2.571 2.757 3.365 4.032 4.773 5.893 6.869
6 0.718 0.906 1.134 1.440 1.943 2.447 2.612 3.143 3.707 4.317 5.208 5.959
7 0.711 0.896 1.119 1.415 1.895 2.365 2.517 2.998 3.499 4.029 4.785 5.408
8 0.706 0.889 1.108 1.397 1.860 2.306 2.449 2.896 3.355 3.833 4.501 5.041
9 0.703 0.883 1.100 1.383 1.833 2.262 2.398 2.821 3.250 3.690 4.297 4.781
10 0.700 0.879 1.093 1.372 1.812 2.228 2.359 2.764 3.169 3.581 4.144 4.587
11 0.697 0.876 1.088 1.363 1.796 2.201 2.328 2.718 3.106 3.497 4.025 4.437
12 0.695 0.873 1.083 1.356 1.782 2.179 2.303 2.681 3.055 3.428 3.930 4.318
13 0.694 0.870 1.079 1.350 1.771 2.160 2.282 2.650 3.012 3.372 3.852 4.221
14 0.692 0.868 1.076 1.345 1.761 2.145 2.264 2.624 2.977 3.326 3.787 4.140
15 0.691 0.866 1.074 1.341 1.753 2.131 2.249 2.602 2.947 3.286 3.733 4.073
16 0.690 0.865 1.071 1.337 1.746 2.120 2.235 2.583 2.921 3.252 3.686 4.015
17 0.689 0.863 1.069 1.333 1.740 2.110 2.224 2.567 2.898 3.222 3.646 3.965
18 0.688 0.862 1.067 1.330 1.734 2.101 2.214 2.552 2.878 3.197 3.611 3.922
19 0.688 0.861 1.066 1.328 1.729 2.093 2.205 2.539 2.861 3.174 3.579 3.883
20 0.687 0.860 1.064 1.325 1.725 2.086 2.197 2.528 2.845 3.153 3.552 3.850
21 0.686 0.859 1.063 1.323 1.721 2.080 2.189 2.518 2.831 3.135 3.527 3.819
22 0.686 0.858 1.061 1.321 1.717 2.074 2.183 2.508 2.819 3.119 3.505 3.792
23 0.685 0.858 1.060 1.319 1.714 2.069 2.177 2.500 2.807 3.104 3.485 3.768
24 0.685 0.857 1.059 1.318 1.711 2.064 2.172 2.492 2.797 3.091 3.467 3.745
25 0.684 0.856 1.058 1.316 1.708 2.060 2.167 2.485 2.787 3.078 3.450 3.725
26 0.684 0.856 1.058 1.315 1.706 2.056 2.162 2.479 2.779 3.067 3.435 3.707
27 0.684 0.855 1.057 1.314 1.703 2.052 2.158 2.473 2.771 3.057 3.421 3.690
28 0.683 0.855 1.056 1.313 1.701 2.048 2.154 2.467 2.763 3.047 3.408 3.674
29 0.683 0.854 1.055 1.311 1.699 2.045 2.150 2.462 2.756 3.038 3.396 3.659
30 0.683 0.854 1.055 1.310 1.697 2.042 2.147 2.457 2.750 3.030 3.385 3.646
40 0.681 0.851 1.050 1.303 1.684 2.021 2.123 2.423 2.704 2.971 3.307 3.551
50 0.679 0.849 1.047 1.299 Module 6
1.676 2.009 2.109 2.403 2.678 2.937 3.261 3.496 March 27, 2018 6 / 65
Problems
Solution:
Given that n = 16, x̄ = 42, s = 10, α = 0.05
Solution:
Given that n = 16, x̄ = 42, s = 10, α = 0.05
Since n < 30, we use t-distribution.
r r
n 16
S = s( ) = 10( ) = 10.33
n −1 15
α
2
= 0.025, degrees of freedom = n − 1 = 15.
Solution contd.
From the table for t-distribution, t0.025,15 = 2.1314.
Thus the 95% confidene interval for population mean µ is
S S
(x̄ − t0.025,n −1 √ , x̄ + t0.025,n −1 √ )
n n
10.33 10.33
(42 − 2.1314( ), 42 + 2.1314( ))
4 4
(36.5, 47.5)
Solution
Given n = 10
Solution
Given n = 10 P
(xi −x̄ )2
x̄ = 66, S 2 = n −1
= 10
Solution
Given n = 10 P
(xi −x̄ )2
x̄ = 66, S 2 = n −1
= 10
1. H0 : µ = 64 against H1 : µ > 64 (Right tailed test)
2. Level of significance α = 0.05
solution contd.
3. Test statistic:
Since population standard deviation is not known and n < 30,
we use t-test.
x̄ − µ 66 − 64
t = = √ =2
√S √10
n 10
Null Hyp H0 : µ1 − µ2 = d
Null Hyp H0 : µ1 − µ2 = d
Test statistic :
Here,
(x1i − x¯1 )2 + (x2i − x¯2 )2
P P
2
S =
n1 + n2 − 2
OR
n1 s12 + n2 s22
S2 =
n1 + n2 − 2
Problems:
1. Samples of two types of electric light bulbs were tested for
length of life and the following data were obtained.
Type I: n1 = 8, x¯1 = 1234 hours, s1 = 36 hours
Type II: n2 = 7, x¯2 = 1036 hours, s2 = 40 hours
Is the differnce in mean sufficient to warrant that Type I is superior
than Type II regarding the length of life?
Solution
Given n1 = 8, n2 = 7, x¯1 = 1234, x¯2 = 1036.
1. H0 : µ1 = µ2 aginst H1 : µ1 > µ2
2. Level of significance α = 0.05
3. Test statistic:
Since population standard deviation is unknown and n < 30, we
apply t-distribution with n1 + n2 − 2 = 13 degrees of freedom.
Solution contd
4. Critical region:
tα,13 = 1.77 and critical region is t > 1.77
Since Cal t > 1.77, we reject H0 .
5. Conclusion:
There is a statistical evidence that Type I is superior to Type II.
H0 : σ12 = σ22
Test Statistic:
S12
F =
S22
(x1i −x¯1 )2 (x2i −x¯2 )2
P P
where S12 = n1 −1
and S22 = n2 −1
.
(Note: The larger among S12 and S22 will be the numerator)
Solution
n1 = 6, n2 = 7, x¯1 = 41.33, x¯2 = 40.43
Solution
n1 = 6, n2 = 7, x¯1 = 41.33, x¯2 = 40.43
1. H0 : σ12 = σ22 (There is no significant difference between the
variances)
H1 : σ12 6= σ22
2. Level of significance α = 0.05
3. Test statistic:
S12
F =
S22
solution contd.
(x1i −x¯1 )2 (x2i −x¯2 )2
P P
where S12 = n1 −1
= 3.06668 and S22 = n2 −1
= 5.61905.
solution contd.
(x −x¯ )2 (x2i −x¯2 )2
P P
where S12 = 1i
n1 −1
1
= 3.06668 and S22 = n2 −1
= 5.61905.
Hence, F = 1.8323.
solution contd.
(x −x¯ )2 (x −x¯ )2
P P
where S12 = 1i
n1 −1
1
= 3.06668 and S22 = 2i
n2 −1
2
= 5.61905.
Hence, F = 1.8323.
From the table of F for (5,6) degrees of freedom, F(6,5) = 4.95.
The critical region is F > 4.95
solution contd.
(x −x¯ )2 (x −x¯ )2
P P
where S12 = 1i
n1 −1
1
= 3.06668 and S22 = 2i
n2 −1
2
= 5.61905.
Hence, F = 1.8323.
From the table of F for (5,6) degrees of freedom, F(6,5) = 4.95.
The critical region is F > 4.95
Since cal F < 4.95, we accept H0 .
solution contd.
(x −x¯ )2 (x −x¯ )2
P P
where S12 = 1i
n1 −1
1
= 3.06668 and S22 = 2i
n2 −1
2
= 5.61905.
Hence, F = 1.8323.
From the table of F for (5,6) degrees of freedom, F(6,5) = 4.95.
The critical region is F > 4.95
Since cal F < 4.95, we accept H0 .
5. Conclusion:
There is no significant difference between the population
variances.
2. Find the rejection region for each hypothesis test based on the
information given. The population is normally distributed.
(a) H0 : µ = 27 Against H1 : µ < 27, α = 0.05, n = 12, σ = 2.2 (Hint:
Since σ is given and population is normally distributed, we apply
Z -test. )
Test whether the samples come from the same normal population at
5% significance level. (Hint: We need to test for (i) population mean
and (ii) population variance. H0 : σ12 = σ22 and µ1 = µ2 . First apply
F-test and then apply t-test) Module 6 March 27, 2018 20 / 65
Chi-square distribution
Applications
- Goodness of fit
- Test for independence
Procedure
1 Formulate the null and alternate hypothesis:
H0 : Two variables are independent
H1 : Two variables are not independent
Procedure
1 Formulate the null and alternate hypothesis:
H0 : Two variables are independent
H1 : Two variables are not independent
2 Calculate the Expected frequencies
E = (row total)(column total) / sample size
Note that each expected value must be greater than or equal to
5 for the chi square test to be valid
Procedure
1 Formulate the null and alternate hypothesis:
H0 : Two variables are independent
H1 : Two variables are not independent
2 Calculate the Expected frequencies
E = (row total)(column total) / sample size
Note that each expected value must be greater than or equal to
5 for the chi square test to be valid
3 Calculate the test statistic:
X (O − E )2
χ2 =
E
df = (r − 1)(c − 1)
df = (r − 1)(c − 1)
df = (r − 1)(c − 1)
1. The side effects of a new drug are being tested against a placebo.
A simple random sample of 565 patients yields the results below. At
a significance level α = 0.10, is there enough evidence to conclude
that the treatment is independent of the side effect of nausea?
1. The side effects of a new drug are being tested against a placebo.
A simple random sample of 565 patients yields the results below. At
a significance level α = 0.10, is there enough evidence to conclude
that the treatment is independent of the side effect of nausea?
Solution
H0 : The treatment and the response are independent.
H1 : The treatment and the response are dependent.
1. The side effects of a new drug are being tested against a placebo.
A simple random sample of 565 patients yields the results below. At
a significance level α = 0.10, is there enough evidence to conclude
that the treatment is independent of the side effect of nausea?
Solution
H0 : The treatment and the response are independent.
H1 : The treatment and the response are dependent.
α = 0.10
solution contd.
Expected frequencies
solution contd.
Expected frequencies
solution contd.
Expected frequencies
solution contd.
Expected frequencies
solution contd.
Expected frequencies
3 Test statistic:
X (O − E )2
χ2 =
E
2
(31 − 24.08) (13 − 17.37)2 (7 − 6.8)2
χ2 = + + ... + = 14.7
24.08 17.37 6.8
3 Test statistic:
X (O − E )2
χ2 =
E
2
(31 − 24.08) (13 − 17.37)2 (7 − 6.8)2
χ2 = + + ... + = 14.7
24.08 17.37 6.8
3 Test statistic:
X (O − E )2
χ2 =
E
2
(31 − 24.08) (13 − 17.37)2 (7 − 6.8)2
χ2 = + + ... + = 14.7
24.08 17.37 6.8
3 Test statistic:
X (O − E )2
χ2 =
E
2
(31 − 24.08) (13 − 17.37)2 (7 − 6.8)2
χ2 = + + ... + = 14.7
24.08 17.37 6.8
Chi-square test enables us to check whether the given data fits the
theoretical distributions such as Binomial, Poisson, Normal, etc.
Chi-square test enables us to check whether the given data fits the
theoretical distributions such as Binomial, Poisson, Normal, etc.
Formulate null and alternate hypothesis
Calculate the expected frequencies
Level of significance
Test statistic:
X (O − E )2
χ2 =
E
degrees of freedom df = k − 1 where k represents the number
of categories
Calculate the critical value (cv) at the given LOS
Chi-square test enables us to check whether the given data fits the
theoretical distributions such as Binomial, Poisson, Normal, etc.
Formulate null and alternate hypothesis
Calculate the expected frequencies
Level of significance
Test statistic:
X (O − E )2
χ2 =
E
degrees of freedom df = k − 1 where k represents the number
of categories
Calculate the critical value (cv) at the given LOS
Conclusion: If χ2 < cv, then accept H0
else reject H0
No. of defects: 0 1 2 3 4
No. of units: 214 92 20 3 1
Fit a Poisson distribution to the data and test for goodness of fit.
No. of defects: 0 1 2 3 4
No. of units: 214 92 20 3 1
Fit a Poisson distribution to the data and test for goodness of fit.
Solution
H0 : The data fits the Poisson distribution
H1 : The data doesnot fit the Poisson distribution
No. of defects: 0 1 2 3 4
No. of units: 214 92 20 3 1
Fit a Poisson distribution to the data and test for goodness of fit.
Solution
H0 : The data fits the Poisson distribution
H1 : The dataPdoesnot fit the Poisson distribution
fx
Mean = λ = P f = 145 330
= 0.439
Expected frequencies:
−λ 0
P (X = 0) = e 0!λ = 0.645
Similarly calculate P (X = 1), P (X = 2), P (X = 3), P (X = 4)
Solution contd.
X 0 1 2 3 4
O 214 92 20 3 1
E 212.75 93.4 20.5 3 0.35
Test statistic:
(O − E )2
χ2 = = 0.0292
E
Solution contd.
X 0 1 2 3 4
O 214 92 20 3 1
E 212.75 93.4 20.5 3 0.35
Test statistic:
(O − E )2
χ2 = = 0.0292
E
Degrees of freedom df = k − 1 = (5 − 3) − 1 = 1
Solution contd.
X 0 1 2 3 4
O 214 92 20 3 1
E 212.75 93.4 20.5 3 0.35
Test statistic:
(O − E )2
χ2 = = 0.0292
E
Degrees of freedom df = k − 1 = (5 − 3) − 1 = 1
Critical value is χ20.05,1 = 3.84
Solution contd.
X 0 1 2 3 4
O 214 92 20 3 1
E 212.75 93.4 20.5 3 0.35
Test statistic:
(O − E )2
χ2 = = 0.0292
E
Degrees of freedom df = k − 1 = (5 − 3) − 1 = 1
Critical value is χ20.05,1 = 3.84
Critical region is χ2 > 3.84.
Solution contd.
X 0 1 2 3 4
O 214 92 20 3 1
E 212.75 93.4 20.5 3 0.35
Test statistic:
(O − E )2
χ2 = = 0.0292
E
Degrees of freedom df = k − 1 = (5 − 3) − 1 = 1
Critical value is χ20.05,1 = 3.84
Critical region is χ2 > 3.84.
Since calculated χ2 < 3.84, we accept H0 . Hence the given data fits
well with Poisson distribution.
Outcome 1 2 3 4 5 6
Frequency 34 44 30 46 51 35
Outcome 1 2 3 4 5 6
Frequency 34 44 30 46 51 35
Solution
H0 : The die is unbiased
H1 : The die is biased
Solution contd.
240
Expected frequencies: E = 6
= 40 where Total frequency is 240.
Solution contd.
240
Expected frequencies: E = 6
= 40 where Total frequency is 240.
Outcome 1 2 3 4 5 6
Frequency 40 40 40 40 40 40
Solution contd.
240
Expected frequencies: E = 6
= 40 where Total frequency is 240.
Outcome 1 2 3 4 5 6
Frequency 40 40 40 40 40 40
(O −E )2
Outcome O E (O − E ) (O − E )2 E
1 34 40 -6 36 0.9
2 44 40 4 16 0.4
3 30 40 -10 100 2.5
4 46 40 6 36 0.9
5 51 40 11 121 3.025
6 35 40 -5 25 0.625