R Under development (unstable) (2023-08-20 r84995 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > require(DoE.wrapper) Loading required package: DoE.wrapper Loading required package: FrF2 Loading required package: DoE.base Loading required package: grid Loading required package: conf.design Attaching package: 'DoE.base' The following objects are masked from 'package:stats': aov, lm The following object is masked from 'package:graphics': plot.design The following object is masked from 'package:base': lengths Loading required package: rsm > options(warn=-1) > > set.seed(1212) > ## test utility functions from DoE.base for designs that are not in > ## DoE.base > > plan <- bbd.design(3) > y <- round(rnorm(nrow(plan)), 4) > lm(y~., plan) Call: lm.default(formula = y ~ ., data = plan) Coefficients: (Intercept) A B C -0.05336 0.40461 -0.17297 -0.82621 > lm(y~., qua.design(plan)) Call: lm.default(formula = y ~ ., data = qua.design(plan)) Coefficients: (Intercept) A.L A.Q B.L B.Q C.L 0.219692 0.572208 0.587132 -0.244624 -0.004031 -1.168441 C.Q 0.754555 > lm(y~., qua.design(plan, quantitative="none", + contrasts=c(A="contr.treatment",B="contr.treatment",C="contr.treatment"))) Call: lm.default(formula = y ~ ., data = qua.design(plan, quantitative = "none", contrasts = c(A = "contr.treatment", B = "contr.treatment", C = "contr.treatment"))) Coefficients: (Intercept) A2 A3 B2 B3 C2 1.3604 -0.3145 0.8092 -0.1680 -0.3459 -1.7504 C3 -1.6524 > > plan <- ccd.design(4) full factorial design needed creating full factorial with 16 runs ... > y <- round(rnorm(nrow(plan)), 4) > lm(y~., plan) Call: lm.default(formula = y ~ ., data = plan) Coefficients: (Intercept) Block.ccd2 X1 X2 X3 X4 -0.01918 -0.03633 -0.26313 0.01479 -0.01686 0.16476 > lm(y~., qua.design(plan)) Call: lm.default(formula = y ~ ., data = qua.design(plan)) Coefficients: (Intercept) Block.ccd2 X1.L X1.Q X1.C X1^4 -0.1300 0.5678 -0.4946 0.1321 0.3352 -0.7047 X2.L X2.Q X2.C X2^4 X3.L X3.Q -0.7659 -0.2097 -0.6813 NA -0.8656 0.3570 X3.C X3^4 X4.L X4.Q X4.C X4^4 -0.6745 NA -0.3086 -0.1339 -0.7259 NA > lm(y~., qua.design(plan, quantitative="none", + contrasts=c(X1="contr.treatment",X2="contr.treatment", + X3="contr.treatment",X4="contr.helmert"))) Call: lm.default(formula = y ~ ., data = qua.design(plan, quantitative = "none", contrasts = c(X1 = "contr.treatment", X2 = "contr.treatment", X3 = "contr.treatment", X4 = "contr.helmert"))) Coefficients: (Intercept) Block.ccd2 X12 X13 X14 X15 1.1355 0.5678 0.4627 -0.8096 -0.2589 -0.4395 X22 X23 X24 X25 X32 X33 -0.4268 -0.4739 NA -1.3854 -0.3595 -1.1272 X34 X35 X41 X42 X43 X44 NA -1.5097 -0.9435 0.2238 -0.1037 NA > > plan <- FrF2(16,4,blocks=2) > y <- round(rnorm(nrow(plan)), 4) > lm(y~., plan) Call: lm.default(formula = y ~ ., data = plan) Coefficients: (Intercept) Blocks1 A1 B1 C1 D1 -0.01171 -0.47509 -0.18052 0.10659 0.08676 0.27060 > lm(y~., qua.design(plan)) Call: lm.default(formula = y ~ ., data = qua.design(plan)) Coefficients: (Intercept) Blocks1 A1 B1 C1 D1 -0.01171 -0.47509 -0.18052 0.10659 0.08676 0.27060 > lm(y~., qua.design(plan, quantitative="none", + contrasts=c(A="contr.treatment",B="contr.treatment", + C="contr.treatment",D="contr.helmert"))) Call: lm.default(formula = y ~ ., data = qua.design(plan, quantitative = "none", contrasts = c(A = "contr.treatment", B = "contr.treatment", C = "contr.treatment", D = "contr.helmert"))) Coefficients: (Intercept) Blocks1 A2 B2 C2 D1 -0.02454 -0.47509 -0.36105 0.21318 0.17352 0.27060 > > plan <- add.response(plan, y) > lm(y~., plan) Call: lm.default(formula = y ~ ., data = plan) Coefficients: (Intercept) Blocks1 A1 B1 C1 D1 -0.01171 -0.47509 -0.18052 0.10659 0.08676 0.27060 > lm(y~., qua.design(plan)) Call: lm.default(formula = y ~ ., data = qua.design(plan)) Coefficients: (Intercept) Blocks1 A1 B1 C1 D1 -0.01171 -0.47509 -0.18052 0.10659 0.08676 0.27060 > lm(y~., qua.design(plan, quantitative="none", + contrasts=c(A="contr.treatment",B="contr.treatment", + C="contr.treatment",D="contr.helmert"))) Call: lm.default(formula = y ~ ., data = qua.design(plan, quantitative = "none", contrasts = c(A = "contr.treatment", B = "contr.treatment", C = "contr.treatment", D = "contr.helmert"))) Coefficients: (Intercept) Blocks1 A2 B2 C2 D1 -0.02454 -0.47509 -0.36105 0.21318 0.17352 0.27060 > > proc.time() user system elapsed 1.12 0.32 1.45