ANOVA Techniques for Crop Yield Analysis
ANOVA Techniques for Crop Yield Analysis
ANALYSIS OF VARIANCE
Definition
Analysis of variance (ANOVA) is a statistical technique specially designed to test
whether the means of more than two quantitative populations are equal.
Types of ANOVA
One-way ANOVA
It is a statistical method used to determine whether there are statistically
significant differences between the means of three or more independent groups.
It is often used when testing the effects of a single independent variable.
ex: Fertilizer is used as an independent variable used to find out the crop yield of
different mixes.
Two-way ANOVA
It is a statistical test used to determine how two independent variables influence
a continuous dependent variable, both individually and in combination.
ex: Fertilizer and type of seed is used is used to find out the crop yield of different
mixes.
Problem
[Link] is the data of 5 variety of plots and 4 crops. Analyse the variance whether
there is significant difference in yield of crops.
P1 P2 P3 P4 P5
C1 42 50 62 34 52
C2 48 66 68 78 70
C3 68 52 76 64 70
C4 80 94 78 82 66
Solution:
C1 C2 C3 C4
P1 42 48 68 80
P2 50 66 52 94
P3 62 68 76 78
P4 34 78 64 82
P5 52 70 70 66
240 330 330 400
Step 1: Setting Ho
Ho- there is no significant difference in mean yield of different crops.
H1- there is significant difference in mean yield of different crops.
Step 2: Test criteria
Since we are comparing the mean between more than 2 groups, we use one way
anova.
Step 3: Test statistics
T = sum of observations
T = 1300
T2/n = 13002/20 (n = R x C)
= 84500
Sum of squares of totals (SST) = sum of square of all observations – T2/n
C1 C2 C3 C4
P1 422 482 682 802
P2 502 662 522 942
P3 622 682 762 782
P4 342 782 642 822
P5 522 702 702 662
C1 C2 C3 C4
P1 1764 2304 4624 6400
P2 2500 4356 2704 8836
P3 3844 4624 5776 6084
P4 1156 6084 4096 6724
P5 2704 4900 4900 4356
NOTE:
It is to be understand that whichever is the higher value becomes the numerator.
here f value = MSC/MSE
Step 4: Level of significance and DOF
LOS: 5%
DOF = K -1, n-k = 3,16
Step 5: Table value
From f table, Critical value = 3.239
Step 6: Comparison of values
Ts>Tv (8.309>3.239), we reject Ho there is significant difference in mean yield
of different crops
Coding method in ANOVA
[Link] whether there is a significant difference between the mean yield of four
varieties of wheat on 5 plots.
Plot/varieties A B C D
1 99 103 104 104
2 101 102 103 100
3 103 100 107 103
4 99 105 97 107
5 98 95 99 106
Plot/varieties A B C D
1 -1 3 9 4
2 1 2 3 0
3 3 0 7 3
4 -1 5 -3 7
5 -2 -5 -1 6
0 5 15 20
Step 1: Setting Ho
Ho: sample means are equal
Step 2: Test criteria
Since we are comparing the mean between more than 2 groups, we use one way
anova
Step 3: Test statistics
T = sum of observations
= 0 + 5 + 15 + 20
= 40
N = 5 x 4 = 20
T2/N = 402/20 = 80
Sum of squares of totals (SST) = sum of square of all observations – T2/n
Plot/varieties A B C D
1 1 9 81 16
2 1 4 9 0
3 9 0 49 9
4 1 25 9 49
5 4 25 1 36
16 63 149 110
Sum of squares of totals (SST) = Sum of square of all observations – T2/n
= 338 – 80
= 258
Sum of square of columns (SSC) = ∑x12/n1 + ∑x22/n2 + ∑x32/n3 +…+ ∑xn2/nn
= 02/5 + 52/5 + 152/ 5 + 202/5 – 80
= 0+ 5 + 45 + 80 – 80
=50
SSE (sum of squared estimation of error) = SST – SSC
= 258 – 50
= 208
Anova table
Variance Sum square DF Mean F value
Between SSC K-1 MSC= SSC/K-1 MSC/MSE
sample OR
P1 6 5 5
P2 7 5 4
P3 3 3 3
P4 8 7 4
A,B,C are varieties of crops and P1,P2,P3,P4 are different [Link] whether
there is significant difference between yield varieties of wheat and difference in
plot.
Solution
Step 1
Setting Hypothesis
Null Hypothesis(H0)
H0C: There is no significant difference between mean yield of variety of wheat.
or
Column means are equal.
H0R: There is no significant difference between mean yield in different plots.
or
Row means are equal.
Alternate Hypothesis(H1)
H1C: There is a significant difference between mean yield of variety of wheat.
or
Column means are not equal.
H1R: There is a significant difference between mean yield in different plots.
or
Row means are not equal.
Step 2
STEP 6
ANOVA TABLE
Problem 4
In a factory, production is carried on by 5 workers, each using 4 types of
machines A,B,C,[Link] following table gives number of units produced perday
by the five workers using the 4 machines.
Workers A B C D
1 46 40 49 38
2 48 42 54 45
3 36 38 46 34
4 46 40 48 35
5 40 45 51 41
1 5 -1 8 -3
2 7 1 13 4
3 -5 -3 5 -7
4 5 -1 7 -6
5 -1 4 10 0
Step 1
Setting Hypothesis
Null Hypothesis(H0)
H0C: Column means are equal
H0R: Row means are equal
Alternate Hypothesis(H1)
H1C: Column means are not equal
H1R: Row means are not equal
Step 2
1 (XR1) 5 -1 8 -3 9
2(XR2) 7 1 13 4 25
3(XR3) -5 -3 5 -7 -10
4(XR4) 5 -1 7 -6 5
5(XR5) -1 4 10 0 13
∑XC 11 0 43 -12 ---------
N=20 C=4 R=5
Sum of all observations(T) = 5+7-5+5-1-1+1-3-1+4+8+13+5+7+10-3+4-7-
6+0= 42
Correction Term(CT) = T2/N = 422/20= 88.2
Step 3
Sum of squares of total (SST) = Sum of squares of observations - CT
Sum of squares of observations = (52+72-52+52-12-12+12-32-
12+42+82+132+52+72+102-32+42-72-62+02)-88.2= 581.8
Sum of squares of columns (SSC)
= ((∑XC1)2/nc1)+( ∑XC2)2/nC2)+( ∑XC3)2/nC3)+( ∑XC4)2/nC4))-CT
= ((112/5)+(02/5)+(432/5)+(-122/5)-88.2=334.6
Sum of squares of rows (SSR)
= ((∑XR1)2/nR1)+( ∑XR2)2/nR2)+( ∑XR3)2/nR3)+ (∑XR4)2/nR4)+ (∑XR5)2/nR5) )-
CT
2
= ((9 /4)+(252/4)+(-102/4)+(52/4)+ (132/4))-88.2 = 161.8
Sum of squares within sample (SSE) = SST-SSC-SSR
= 581.8-334.6-161.8 = 85.4
Step 4
Mean squares due to columns (MSC) = (SSC)/(C-1)
=(334.6)/(4-1)= 111.53
Mean squares due to rows (MSR) = (SSR)/(R-1)
= (161.8)/(5-1) = 40.45
Mean squares due to sample (MSE) = (SSE)/(C-1)(R-1)
= (85.4)/(4-1)(5-1)= 7.11
Step 5
Find the value of F due to column and row
FC = MSC/MSE = 111.53/7.11= 15.68
FR = MSR/MSE = 40.45/7.11 = 5.68
STEP 6
ANOVA TABLE
Step 7
Find the value of F from table
Here take level of significance α = 5%
F value due to column F value due to row
Degree of freedom df, Degree of freedom df,
df = ((C-1),(C-1)(R-1)) df = ((R-1),(R-1)(C-1))
=((4-1),(4-1)(5-1)) =((5-1),(5-1)(4-1))
df(3,12) df(4,12)
Ftable = 3.49 Ftable = 3.26
Calculated value is greater than Calculated value is greater than
table value table value
15.68>3.49 7.11>3.26
Therefore null hypothesis(H0) Therefore null hypothesis(H0)
is Rejected, Alternate hypothes is Rejected, Alternate hypothes
is(H1) is Accepted is(H1) is Accepted
RANDOMISED COMPLETE BLOCK DESIGN
Analysis of Variance
Suppose in investigating the performance of the 3 types of cars, 5 drivers were each
assigned one car of each type. In statistics, this is called a randomised complete
block design, consisting of b=5 blocks, with k=3 treatments. Each block contains
matched groups of k experimental units – one unit for each treatment - so in this
example there are three experimental units in each block.
The analysis of variance for an RCBD partitions the total sum of squares into three
parts:
Note that the table is similar to the Completely Randomised ANOVA table, but
there is now a row included for blocks. b is generally used to represent the
number of blocks involved. Using this added information, the table can be
completed:
b. The treatments are randomly assigned to the experimental units within block.
• Calculate the Mean Square for Block, Group and Error – divide
Block
MS Error MS Error
CF = ( all entries ) 2
=
( y) 2
= 1170.42 .
number of entries n
(iii) Calculate the Total Sum of Squares ( y ) 2
n
(iv) Calculate the Block Sum of Squares
(25 2
+ 26.82 + 26.32 + 25.82 + 28.62 ) 132.52
SSblock = − = 2.427
3 15
(v) Calculate the Treatment Sum2 of Squares
40 2 432 49.52 ( y)
= + + − = 9.43
5 5 5 n
(vi) Calculate the Error Sum of Squares
SSerror = SStotal − SSblock − SSregression = 13.69 − 2.427 − 9.43 = 1.833
(vii) Calculate
2.427 9.43
MSblock = = 0.60675 MStreatment = = 4.715
4 2
1.833
MS error = = 0.229
8
4.715
(viii) Calculate F Fblock =
0.60675
= 2.64 Ftreatment = = 20.6
0.229 0.229
SOURCE df SS MS F p
Blocks 4 2.427 0.60675 2.65 not significant
Treatment 2 9.43 4.715 20.6 p<0.001
Error 8 1.833 0.229
Total 14 13.69
Practice questions
1. A Randomised Complete Block Design was used for an experiment on grapes
to test the effect of bird repelling netting on the sugar content of the grapes at
harvest. (The netting has some shading effect, and the beneficial effect of
repelling birds has to be balanced against loss of production.)
There were 8 blocks and 5 netting treatments (one of which is a control: that is
no netting.) Fill out the following part of and an Analysis of Variance Table with
the correct number of degrees of freedom for each of the appropriate sources
of variance. (Note there may be more than two required here.)
2. A trial examined the effectiveness of three types of insect traps. The three
traps were set out five separate periods, which can be thought of as “blocks”,
and the average number of insects caught recorded.
The data and the row and column totals are displayed as follows:
`Rows: weight group Columns: cigarette group
1 2 3 All
1 3.2 2.8 1.7 7.7
2 3.2 2.8 2.5 8.5
3 3.2 3.1 2.5 8.8
4 3.4 3.1 2.6 9.1
5 3.5 3.3 2.8 9.6
6 3.5 3.4 2.9 9.8
All 20.0 18.5 15.0 53.5
(i) Complete the ANOVA table below
(ii) Calculate the standard error of the difference between the cigarette
consumption means.
SStrap 427142
2. MStrap = = = 213571
df trap 2
3. P > 0.05.
Method: Look up critical values of F in tables for df1 = 4, and df2 = 8 for
various values of a. F.05,4,8 = 3.84 = 3.838 (depending on your table). Compare
the tables F values with the calculated F (2.64 - from the ANOVA table in the
question). Because Fcalc < F.05, conclude that P > 0.05.
SScig 2.194
(d) MScig = = = 1.097
df cig 2
(e) as above.
Problem :1
The following is a Latin square of a design, when 4 varieties of seeds are being tested.
Set up the analysis of variance table and state your conclusion. You may carry out
suitable change of origin and scale.
1
A (105) B (95) C (125) D (115)
C (115) D (125) A (105) B (105)
D (115) C (95) B (105) A (115)
B (95) A (135) D (95) C (115)
Solution: Subtract 100 and then divided by 5, we get
𝑋 𝑋 𝑋 𝑋 TOTAL 𝑋 𝑋 𝑋 𝑋
𝑌 1 -1 5 3 8 1 1 25 9
𝑌 3 5 1 1 10 9 25 1 1
𝑌 3 -1 1 3 6 9 1 1 9
𝑌 -1 7 -1 3 8 1 49 1 9
TOTAL 6 10 6 10 T=32 20 76 28 28
= = 64
2
STEP 4: Compute the total sum of squares in columns TSS
=20+76+28+28-64 =88
STEP 5: Compute the sum of squares of column SSC
(∑ ) (∑ ) (∑ ) (∑ )
SSC= + + + -
=4
STEP 6: Compute the sum of squares of row SSR
(∑ ) (∑ ) (∑ ) (∑ )
SSR = + + + -
=2
Total
A 1 1 3 7 12
B -1 1 1 -1 0
C 5 3 -1 3 10
D 3 5 3 -1 10
SSK= + + + - 64
=22
STEP 8 : Computing sum of squares of errors SSE
SSE=TSS-SSC-SSR-SSK
3
=88-4-2-22
=60
STEP 9: ANOVA
= .
=7.52>1
𝑆𝑆𝑅
Between SSR=2 K-1=4-1 𝑀𝑆𝑅 = MSE>MSR MSE>MSR
𝐾−1 𝑀𝑆𝐸 FR(6,3)=8.94
rows 𝐹 =
= = 0.67 𝑀𝑆𝑅
= .
=14.9>1
𝑆𝑆𝐾
Between SSK=22 K-1=4-1 𝑀𝑆𝐾 = MSE>MSK MSE>MSK
𝐾−1 FK(6,3)=8.94
treatments
= =7.33 𝐹 =
= . =1.36>1
So, we accept H0 for this case, i.e., there is no significant difference between
columns.
4
Calculated FR value > Table FR value, i.e., 14.93 > 8.94.
So, we reject Ho for this case, i.e., there are significant differences in rows.
So, we accept Ho for this case, i.e., there is no significant difference between
treatments.
5
FACTORIAL EXPERIMENTS
A two-factorial experiment is a study where two factors (variables) are tested simultaneously
to see how they affect an outcome (response). Each factor has two or more levels (e.g.,
high/low or different types). The experiment also examines if the two factors interact,
meaning if their combined effect is different from their individual effects.
Methods
Primer type Dipping Spraying
1 4.0,4.5,4.3 5.4,4.9,5.6
2 5.6,4.9,5.4 5.8,6.1,6.3
3 3.8,3.7,4.0 5.5,5.0,5.0
Solution:
Solution:
Define the Hypothesis:
For Primer type:
• H0: μ1=μ2=μ3=0
• H1:at least one μi≠0
For Method type:
• H0: μD=μS=0
• H1:at least one μj≠0
For interaction:
• H0: μ1D1=μ1S1=μ2D1=………=μ3S2=0
• H1:at least one μijk≠0
SS Total=∑∑∑ x2ijk – C
(89.8)2
= (42)+(4.5)2+……..+(5)2 +(5)2 - 18
=
10.72
𝑇2
SS Primer=∑18𝑖 - C
=4.58
𝑇2
SS Method =∑ 𝑛𝑖 - C
𝑗
= 4.91
𝑇2
SS interaction =∑∑ 𝑛𝑖 - C-SS Primer – SS method
𝑗
= 0.24
ANOVA Table
Source of Degree of Sum of squares Mean Square F-ratio
variation freedom
Primer 2 4.58 2.29 28.63
Methods 1 4.91 4.91 61.38
Interaction 2 0.24 0.12 1.50
Error 12 0.99 0.08
Total 17 10.72
Critical value F(2,12) (0.05) =3.89
F(1,12)(0.05) =4.75