One Way ANOVA, Two Way ANOVA and Interaction ANOVA
One Way ANOVA, Two Way ANOVA and Interaction ANOVA
One Way ANOVA, Two Way ANOVA and Interaction ANOVA
Conclusion:
Critical value of F is obtained from F table with (k-1) and (N-k)
df at α level of significance ,usually 0.05 or 0.01
If F(calculated)≤critical value then accept
Otherwise Reject
OR p value<0.05,Reject .Otherwise Accept
Example :
Following data is regarding sales(in 1000 Rs) of five salesmen.
Sales Salesman A Salesman B Salesman C Salesman D Salesman E
IN R
The R function is aov().
The function summary.aov() is used to summarize the analysis of variance model.
Example:
#Import excel file One way ANOVA
#One way ANOVA
result=aov(Sales~Salesman,data=one_way_ANOVA)
summary(result)
#OR
result=oneway.test(Sales~Salesman,data=one_way_ANOVA,var.equal = T)
Result
#OR
anova(lm(Sales~Salesman,data=one_way_ANOVA))
OUT PUT
Df Sum Sq Mean Sq F value Pr(>F)
Salesman 4 1241 310.1 0.713 0.589
Residuals 32 13914 434.8
Example
# dataset population from package tidyr
population
result=aov(population~country,data=population
)
summary(result)
Out put
Df Sum Sq Mean Sq F value Pr(>F)
country 218 5.953e+19 2.731e+17 4459 <2e-16
Residuals 3841 2.352e+17 6.125e+13
TWO WAY ANOVA
This test is applied to find significance difference
between several means of two variables.
Null hypothesis is a) H0 :
b) H0 :
Alternative hypothesis is
a) Ha=
b) Ha:
Test procedure:
CF =, where G=, i=1,2,------,r and j=------------,c N=
rxc , r is number of rows and c is number of columns
Total sum of squares is calculated as follows,
TSS= – CF
Sum of squares due to rows is calculated as
follows,
SSR=
SSC=
Where total of all the values in ith row
total of all the values in jth column
Sum of squares due to error is given by
SSE=TSS-SSR-SSC
ANOVA Table
Source df Sum of Mean sum of F ratio
squares(SS) square(MSS=SS/df)