One-Way ANOVA: Borbon, Klied Erica B. Largo, Vyankha Jhouana L
One-Way ANOVA: Borbon, Klied Erica B. Largo, Vyankha Jhouana L
One-Way ANOVA
1. Three sections of the same elementary mathematics courses are
taught by three teachers. The final grades were recorded as
follows:
Teacher
A B C
73 88 68
89 78 79
82 48 56
43 91 91
80 51 71
73 85 71
66 74 87
60 77 41
45 31 59
93 78 68
36 62 53
77 76 79
96 15
80
56
19.23782 0.9171
0.1732 2
A 337.598 2
Residuals 13323.376 36
Subject
Student Mathematics English French Biology
1 68 57 73 61
2 83 94 91 86
3 72 81 63 59
4 55 73 77 66
5 92 68 75 87
Use a 0.05 level of significance to test the hypothesis that
Interpratation:
Subject 42.150 3
Students 46.225 1
Residuals 2578.300 12
Interpretation:
Part 1.
1. Homogeneity of Variances:
> t<-read.csv("D:/aaaaa.csv",header=T,sep="," )
> t
A X73
1 A 89
2 A 82
3 A 43
4 A 80
5 A 73
6 A 66
7 A 60
8 A 45
9 A 93
10 A 36
11 A 77
12 B 88
13 B 78
14 B 48
15 B 91
16 B 51
17 B 85
18 B 74
19 B 77
20 B 31
21 B 78
22 B 62
23 B 76
24 B 96
25 B 80
26 B 56
27 C 68
28 C 79
29 C 56
30 C 91
31 C 71
32 C 71
33 C 87
34 C 41
35 C 59
36 C 68
37 C 53
38 C 79
39 C 15
> bartlett.test(X73~A, data=t)
data: X73 by A
Bartlett's K-squared = 0.1732, df = 2, p-value = 0.9171
Terms:
A Residuals
Sum of Squares 337.598 13323.376
Deg. of Freedom 2 36
2.
> a<-read.csv("D:/final1.csv",header=T,sep=",")
> a
Subject Students Grades
1 Mathematics 1 68
2 Mathematics 2 83
3 Mathematics 3 72
4 Mathematics 4 55
5 Mathematics 5 92
6 English 1 57
7 English 2 94
8 English 3 81
9 English 4 73
10 English 5 68
11 French 1 73
12 French 2 91
13 French 3 63
14 French 4 77
15 French 5 75
16 Biology 1 61
17 Biology 2 86
18 Biology 3 59
19 Biology 4 66
20 Biology 5 87
> b=aov(Grades~Subject*Students,data=a)
> b
Call:
aov(formula = Grades ~ Subject * Students, data = a)
Terms:
Subject Students Subject:Students Residuals
Sum of Squares 42.150 46.225 106.275 2578.300
Deg. of Freedom 3 1 3 12
Terms:
Subject Students Subject:Students Residuals
Sum of Squares 157.937 2.025 467.025 22634.400
Deg. of Freedom 3 1 3 72
data: t$X73
W = 0.94508, p-value = 0.05616
> bartlett.test(X73~A, data=t)
data: X73 by A
Bartlett's K-squared = 0.1732, df = 2, p-value = 0.9171
> LSD.test(model,"A",p.adj="bon",console=TRUE)
A, means
Critical Range
2 3
20.68556 21.57125
2.
> shapiro.test(a$Grades)
data: a$Grades
W = 0.95858, p-value = 0.5159
> bartlett.test(Students~Subject, data=a)
Subject, means
Critical Range
2 3 4
2.920782 3.046418 3.128607
> library(agricolae)
> model<-aov(Students~Subject, data=a)
> out<-LSD.test(model,"virus", p.adj="bonferroni")
> attach(a)
> df<-df.residual(model)
> MSerror<-deviance(model)/df
> out<-LSD.test(model,"Subject", p.adj="bonferroni")
> out
$statistics
Mean CV MSerror LSD
3 52.70463 2.5 3.008334
$parameters
Df ntr bonferroni
16 4 3.008334
$means
Students std r LCL UCL Min Max
Biology 3 1.581139 5 1.501001 4.498999 1 5
English 3 1.581139 5 1.501001 4.498999 1 5
French 3 1.581139 5 1.501001 4.498999 1 5
Mathematics 3 1.581139 5 1.501001 4.498999 1 5
$comparison
NULL
$groups
trt means M
1 Biology 3 a
2 English 3 a
3 French 3 a
4 Mathematics 3 a
3.> shapiro.test(v$Grades)
data: v$Grades
W = 0.95499, p-value = 0.006728
> bartlett.test(Students~Subject, data=v)
Critical Range
2 3 4
1.212269 1.263747 1.298570
$parameters
Df ntr bonferroni
76 4 2.70907
$means
Students std r LCL UCL Min Max
Biology 3 1.450953 20 2.353816 3.646184 1 5
English 3 1.450953 20 2.353816 3.646184 1 5
French 3 1.450953 20 2.353816 3.646184 1 5
Mathematics 3 1.450953 20 2.353816 3.646184 1 5
$comparison
NULL
$groups
trt means M
1 Biology 3 a
2 English 3 a
3 French 3 a
4 Mathematics 3 a