# ---- Chunk 1: (hidden) ----- options(width = 100) # ---- Chunk 2: page 3 ----- library("rsm") ChemReact # ---- Chunk 3: page 3 ----- CR <- coded.data(ChemReact, x1 ~ (Time - 85)/5, x2 ~ (Temp - 175)/5 ) CR[1:7, ] ### Initial experiment only # ---- Chunk 4: page 4 ----- code2val(data.frame(x1=c(0.25, 0.5), x2 = c(-1.5, -0.5)), attr(CR, "codings")) # ---- Chunk 5: page 4 ----- bbd(3, n0=2, coding = list(x1 ~ (Force - 20)/3, x2 ~ (Rate - 50)/10, x3 ~ Polish-4)) # ---- Chunk 6: page 6 ----- ccd.pick(5, n.c = c(8, 16), blks.c = c(1, 2, 4), wbr.s = 1:2, restrict = "N<=65") # ---- Chunk 7: page 7 ----- des1 <- ccd(y1 + y2 ~ A + B + C + D, generators = E ~ - A * B * C * D, n0 = c(6, 1)) # ---- Chunk 8: page 7 ----- des10 <- ccd(~ A + B + C + D + E, blocks = Blk ~ c(A * B * C, C * D * E), n0 = c(2, 4)) # ---- Chunk 9: page 8 ----- CR.rsm1 <- rsm(Yield ~ FO(x1, x2), data = CR, subset = (Block == "B1")) summary(CR.rsm1) # ---- Chunk 10: page 9 ----- CR.rsm1.5 <- update(CR.rsm1, . ~ . + TWI(x1, x2)) summary(CR.rsm1.5) # ---- Chunk 11: page 9 ----- CR.rsm2 <- rsm(Yield ~ Block + SO(x1, x2), data = CR) summary(CR.rsm2) # ---- Chunk 12: page 11 ----- heli.rsm <- rsm(ave ~ block + SO(x1, x2, x3, x4), data=heli) summary(heli.rsm) # ---- Chunk 13: page 12 ----- par(mfrow = c(2, 3)) contour(heli.rsm, ~ x1 + x2 + x3 + x4, at = summary(heli.rsm)$canonical$xs) # ---- Chunk 14: page 13 ----- steepest(CR.rsm1, dist = c(0, 0.5, 1)) # ---- Chunk 15: page 14 ----- canonical.path(heli.rsm, dist = seq(-5, 5, by = 0.5))