In: Math
PLEASE USE R PROGRAMMING TO SOLVE THIS AND GIVE A COPYABLE CODE
Professor David teach Math 1054. In that course, there are 5 exams, 4 midterm exams, plus final exam. You are asked to help him to check whether there is significant difference among the difficulty level in these 5 exams. The data is stored in Math1054Exam.txt.
a). read in data (copy your R code)
b). Find averages for these exams. You can use mean(V) function, or summary(data) function.
c). Are these averages differ significantly? We need to use ANOVA. For this purpose, you need to use stack function to change the data format as two column, one is score, the
other is exam index.
d). Produce a boxplot for the five exams.
e). Conduct ANOVA test.
f). Copy your ANOVA table.
g). Make your conclusion.
------------------------------------------------------------------------------4
Math1054Exam.txt.
T1 T2
T3 T4 Final
90 69 62 65
92
67 59 78 63
43
76 73 66 41
71
80 92 46 92
70
98 79 60 84
99
82 80 69 83
94
69 45 47 70
37
83 90 54 66
50
93 94 90 94
99
66 67 50 52
32
45 71 55 58
83
76 92 65 72
95
73 92 84 70
77
81 68 30 53
34
60 58 43 50
36
92 90 86 89
95
62 54 52 60
88
85 80 65 82
88
69 80 81 67
75
71 88 43 61
89
data =read.table("../Documents/Tutoring/Software/random data/exam.txt",header =T)
#b
sapply(data, mean)
#c
sData<- stack(data)
model <- aov( values~ind , sData)
summary(model)
#d
boxplot(data)
b)
c)
p-value = 0.0414 < alpha (0.05)
hence we reject the null hypothesis
we conclude that there is significant difference
d)
e)
p-value = 0.0414 < alpha (0.05)
hence we reject the null hypothesis
we conclude that there is significant difference
f)
Df Sum Sq Mean Sq F value Pr(>F) ind 4 3021 755.3 2.593 0.0414 * Residuals 95 27672 291.3 ---
g)
p-value = 0.0414 < alpha (0.05)
hence we reject the null hypothesis
we conclude that there is significant difference
Please rate