library(rsm)
### Generate a standard 3-variable CCD with 12 runs in each block
des = ccd(3, n0=c(4,6), coding = list(x1 ~ (Temp - 150)/10,
x2 ~ (Pres - 50)/5, x3 ~ Feedrate - 4))
decode.data(des)
### Same as above, except make the design rotatable,
### and inscribed so that no coded value exceeds 1
des2 = ccd(3, n0=c(4,6), alpha = "rotatable", inscribed = TRUE,
coding = list(x1 ~ (Temp - 150)/10,
x2 ~ (Pres - 50)/5, x3 ~ Feedrate - 4))
decode.data(des2)
### Generate a 5-variable design in 2 blocks. The cube block has 16 runs
### This design will have alpha = 2; it is both orthogonal and rotatable
ccd(~ x1 + x2 + x3 + x4, x5 ~ x1 * x2 * x3 * x4, n0 = c(6,1))
### Generate a 5-variable design with 5 blocks:
### 4 blocks of 8 cube points each, and 1 block with star points
### You'll get alpha = 2.366; if you add alpha = "rot", you'll get 2.378
des = ccd(y1 + y2 ~ A + B + C + D + E, , Shift ~ c(-A*B*C, C*D*E), n0=c(2,4))
Run the code above in your browser using DataLab