Professional Documents
Culture Documents
Lesson 6
Lesson 6
OF
AGRICULTURE & TECHNOLOGY
tion/answer.
6 Hypothesis Testing 2 5
6.1 Analysis of Variance (ANOVA) . . . . . . . . . . 6
• Components of total Variability . 8
6.1.1 Techniques of One-way ANOVA . . . . . . 10
6.2 Chi-Square Test . . . . . . . . . . . . . . . . . . . 32
JJ II 6.2.1 Contingency Table Analysis . . . . . . . . 43
J I 6.3 Limitations of Hypothesis Testing . . . . . . . . . 51
J DocDoc I
Back Close 3
HCBA 3102 STATISTICS FOR BUSINESS
©JKUAT-SODeL Solutions to Exercises . . . . . . . . . . . . . . . . 54
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 4
HCBA 3102 STATISTICS FOR BUSINESS
LESSON 6
Hypothesis Testing 2
Learning outcomes
Upon completion of this lessonyou should be able to;
©JKUAT-SODeL
Introduction
JJ II
J I This lessoncombines two topics which may appear totally unre-
J DocDoc I lated. While the first topic (ANOVA) deals with ratio/interval
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 5
HCBA 3102 STATISTICS FOR BUSINESS
versus categorical variables, the second part (CHI-SQUARE) as-
sumes categorical variables. You will released that both topics
are still on hypothesis testing.
unknown variance σ 2 .
2. Independence of Samples : All the sample observations
must be selected randomly. The total variation of the var-
ious sources of variation should be additive.
3. Additivity : The total variation of the various sources of
variation should be additive.
4. Equal variances (but unknown) : The populations from
JJ II
which the k samples say are drawn have means µ1 , µ2 , ...µk
J I
and unknown variance σ12 = σ22 = ...... = σk2 = σ 2 .
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 9
HCBA 3102 STATISTICS FOR BUSINESS
5. The error components are independent and have mean 0
and variance σ 2 .
The tests of significance performed in the analysis of variance
are meaningful under its assumptions.
n1 + n2 + ....... + nk = n
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 10
HCBA 3102 STATISTICS FOR BUSINESS
2. Linear Model
xij = µ + αi + eij
Where xij = observations i = 1, 2, ....k, j = ni
µ = The general mean
©JKUAT-SODeL
µ1 = µ2 = ...., = µk
JJ II
J I H1 : H0 A least two of the means are not equal.
J DocDoc I 4. Computations:
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 11
HCBA 3102 STATISTICS FOR BUSINESS
(i) Calculate sum of observations in each sample and of all
observations.
Sum of sample observations : x1 , x2 , ...... xk .
P P P
T2
(ii) Calculate correction factor CF = n
Where T = Square of the sum of all the observations =
P
x
n= Total number of observations
(iii) Calculate group means x¯1 , x¯2 , ....., x¯k and their com-
mon mean x̄¯. where x¯k = Σx
nk
k
, x̄¯ = Σx n
(iv) Calculate total sum of squares by the formula
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 12
HCBA 3102 STATISTICS FOR BUSINESS
T SS = Σ(x − x̄¯)2
T2
= (Σx21 + Σx22 + ..... + Σkn2 ) −
n
(Σx)2
= Σx2 −
©JKUAT-SODeL
(Σx1 )2 Σxk )2 T2
+ ... + −
n1 nk n
JJ II
J I (vi) Calculate sum of squares within samples by the for-
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 13
HCBA 3102 STATISTICS FOR BUSINESS
mula
SSW = T SS − SSB
JJ II
J I M SSB = Mean sum of squares between samples
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 14
HCBA 3102 STATISTICS FOR BUSINESS
JJ II where n − 1 = (k − 1) + (n − k)
J I
(viii) Obtain the variance ratio F :
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 15
HCBA 3102 STATISTICS FOR BUSINESS
Variance ratio,
Fe = Calculated value of F
Ft = F05 (v1 , v2 ) = Tabulated value of F
JJ II Here
J I v1 = degree of freedom for numerator
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 16
HCBA 3102 STATISTICS FOR BUSINESS
v2 = degree of freedom for denominator
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 17
HCBA 3102 STATISTICS FOR BUSINESS
Analysis of Variance Table
Samples
¯)2 SSW
Within Σ(xk − x̄ n−k n−k = M SSW
samples (SSW )
Total ¯)2
Σ(x − x̄ n−1
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 18
HCBA 3102 STATISTICS FOR BUSINESS
Solution:
Computation of Arithmetic Mean
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 19
HCBA 3102 STATISTICS FOR BUSINESS
Blocks Varieties
I II III IV
1 10 7 8 5
2 9 8 5 8
3 8 6 5 5
Total 27 21 18 18
©JKUAT-SODeL
Mean(x̄) 9 7 6 6
Mean of all means
9+7+6+6 28
(x̄¯) = = =7
4 4
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 20
HCBA 3102 STATISTICS FOR BUSINESS
Sum of the squares of the deviations
= 12 + 0 + 3 + 3 = 18
Σ[nk(x¯k − x̄¯)2 ] 18
= = =6
(k − 1) 3
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 21
HCBA 3102 STATISTICS FOR BUSINESS
Variance within Samples: Sum of the squares of the de-
viations
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 22
HCBA 3102 STATISTICS FOR BUSINESS
Since Fc < Ft , hence the four varieties of wheat are not signif-
icantly different with regard to yield i.e., This difference is due
to fluctuations of sampling.
Varieties
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 23
HCBA 3102 STATISTICS FOR BUSINESS
I II III IV
2 2 2 2
(10 − 7) = 9 (7 − 7) = 0 (8 − 7) = 1 (5 − 7) = 4
(9 − 7)2 = 4 (8 − 7)2 = 1 (5 − 7)2 = 4 (8 − 7)2 = 1
(8 − 7)2 = 1 (6 − 7)= 1 (5 − 7)2 = 4 (5 − 7)2 = 4
Total 14 2 9 9
©JKUAT-SODeL
5 I 2 9
6 II 2 8
7 III 2 5
8 IV 2 8
9 I 3 8
10 II 3 6
11 III 3 5
12 IV 3 5
JJ II
Notice that the data now consists of three variables and both
J I
One-way-Anova and Two-Way ANOVA can be applied to the
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 25
HCBA 3102 STATISTICS FOR BUSINESS
data. It is always good practice to include a identification num-
ber for each observation.
Example . Consider the following data as captured in SPSS
file.
©JKUAT-SODeL
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 26
HCBA 3102 STATISTICS FOR BUSINESS
©JKUAT-SODeL
JJ II
J I Suppose we wish to test whether performance in Maths depends
J DocDoc I on School category. One can proceed to perform several t-test
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 27
HCBA 3102 STATISTICS FOR BUSINESS
taking a pair at a time (Boarding vs Day, Boarding vs Mixed and
Day vs Mixed) but this is not recommended. The appropriate
test is One-Way Since gender has only two categories, the test is
simply a comparison of two group means. To determine whether
the differences are by chance, the appropriate test is independent
samples t-test with the hypothesis;
©JKUAT-SODeL
H0 : µm = µf versus H1 : µm 6= µf .
estimates.
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 31
HCBA 3102 STATISTICS FOR BUSINESS
6.2. Chi-Square Test
Chi-Square Tests are based on Chi-square distribution which has
the following characteristics
• It is positively skewed
• It is non-negative
©JKUAT-SODeL
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 32
HCBA 3102 STATISTICS FOR BUSINESS
©JKUAT-SODeL
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 34
HCBA 3102 STATISTICS FOR BUSINESS
5 7
6 5
1
E = ( )(36) = 6
6
JJ II (Ef − Of )2
J I Ef
J DocDoc I Table 6.6 shows these calculations.
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 36
HCBA 3102 STATISTICS FOR BUSINESS
5 6 7 0.167
6 6 5 0.167
X (Ef − Of )2
JJ II = 0.667 + 0.167 + ... + 0.167 = 5.33
Ef
J I
J DocDoc I This sampling distribution of
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 37
HCBA 3102 STATISTICS FOR BUSINESS
X (Ef − Of )2
Ef
is approximately distributed as Chi-Square on k − 1 degrees of
freedom where k is the number of categories. Therefore, for this
problem the test statistic is
©JKUAT-SODeL
χ25 = 5.333
H0 : Of = Ef
H1 : Of 6= Ef
" #
2 (Of − Ef )2
χ =Σ
Ef
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 40
HCBA 3102 STATISTICS FOR BUSINESS
Status O E (O − E)2 /E
Married 310 319.5 0.2825
Widowed 40 38.5 0.0584
Divorced 30 34.5 0.587
Single 120 107.5 1.4535
©JKUAT-SODeL
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 41
HCBA 3102 STATISTICS FOR BUSINESS
Exercise 2. The following data on reported crimes was col-
lected from a certain city.
Day Frequency
Monday 89
Tuesday 45
©JKUAT-SODeL
Wednesday 50
Thursday 56
Friday 60
X O2
χ2c = − Tt
E
Tr × Tc
E=
Tt
(|Of − Ef | − 0.5)2
χ2c =Σ
Ef
Since χ2c = 21.334 >χ2t,α = 7.81. We reject the null hypothesis and
conclude that the data provides sufficient evidence to conclude that
the claim is valid.
But there are several limitations of the said tests which should al-
ways be borne in mind by a researcher. Important limitations are as
follows:
J I be sufficiently enlarged.
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 52
HCBA 3102 STATISTICS FOR BUSINESS
All these limitations suggest that in problems of statistical signifi-
cance, the inference techniques (or the test) must be combined with
adequate knowledge of the subject - matter along with the ability of
make good judgment.
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 54
HCBA 3102 STATISTICS FOR BUSINESS
Exercise 4. The hypothesis to be tested is
H0 : Snoring and heart disease are not related
H1 : Snoring and heart disease are related
Never Occasionally Snores Snores every night
Heart disease 50(64.8) 90(97.2) 130(108)
No heart disease 70(55.2) 90(82.8) 70(55.2)
©JKUAT-SODeL
JJ II
J I
J DocDoc I
Back Close JKUAT, Setting trends in higher Education, Research and Innovation 56