Commit da7d1d40 authored by Robert Ricci's avatar Robert Ricci

R commands to be used for chapter 20 material

parent f20a6519
r = 5
c = 3
time = c(144,120,176,288,144,101,144,211,288,72,130,180,141,374,302)
system = c(rep("A",r),rep("B",r),rep("C",r))
Y = matrix(time,r,c)
YF = data.frame(time, system)
Y
plot(time ~ system, YF)
gtotal = sum(Y)
gmean = gtotal / length(Y)
mA = sum(Y[,1]) / r
mB = sum(Y[,2]) / r
mC = sum(Y[,3]) / r
aA = mA - gmean
aB = mB - gmean
aC = mC - gmean
M = matrix(gmean,r,c)
A = matrix(c(rep(aA,r),rep(aB,r),rep(aC,r)),r,c)
M
A
E = Y - M - A
SSA = sum(A^2)
SSE = sum(E^2)
SST = SSE + SSA
SSA / SST
aov(time ~ system, YF)
summary(aov(time ~ system, YF))
P = matrix(c(rep(mA,r),rep(mB,r),rep(mC,r)),r,c)
qqplot(P,E)
qqnorm(E)
-----
time = c(rnorm(5,15,2),rnorm(5,3,4),rnorm(5,6,1))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment