library(DoE.wrapper)
Design.1_2<- bbd.design(nfactors= 3 , ncenter= 4 ,randomize= FALSE,seed=7480,
factor.names=list( A=c(0,400),B=c(600,2200),C=c(1,10) ) )
res=c(73.450,75.725,63.980,67.670,76.070,77.345,66.005,67.335,84.740,81.595,74.830,70.325,72.460,73.170,73.925,73.800)
length(res)
#Medidas resumo
Design.1_2<- add.response(Design.1_2,res, replace=FALSE)
plancoded<- code.design(Design.1_2)
plancoded
LinearModel.1 <- aov(res ~(x1+x2+x3)^2+ I(x1^2) + I(x2^2) + I(x3^2),
data=plancoded)
sreg = step(LinearModel.1,direction="both")
#Melhor modelo
#Step: AIC=14.07
#res ~ x1 + x2 + x3 + I(x1^2) + I(x2^2) + I(x3^2)
# Df Sum of Sq RSS AIC
#<none> 16.074 14.074
#+ x1:x2 1 0.501 15.574 15.568
#+ x2:x3 1 0.462 15.612 15.607
#+ x1:x3 1 0.001 16.073 16.073
#- x1 1 9.181 25.255 19.303
#- I(x2^2) 1 9.310 25.384 19.385
#- I(x3^2) 1 36.195 52.269 30.941
#- x2 1 79.223 95.297 40.551
#- I(x1^2) 1 86.793 102.867 41.774
#- x3 1 212.747 228.821 54.566
summary(sreg)
# Df Sum Sq Mean Sq F value Pr(>F)
#x1 1 9.18 9.18 5.140 0.04959 *
#x2 1 79.22 79.22 44.357 9.27e-05 ***
#x3 1 212.75 212.75 119.118 1.72e-06 ***
#I(x1^2) 1 86.79 86.79 48.596 6.53e-05 ***
#I(x2^2) 1 9.31 9.31 5.213 0.04831 *
#I(x3^2) 1 36.20 36.20 20.266 0.00149 **
#Residuals 9 16.07 1.79
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Design.1_2.coded<-plancoded
rsmModel.2 <- rsm(res ~ FO(x1, x2, x3) + TWI(x1, x2, x3) + PQ(x1, x2, x3),
data=Design.1_2.coded)
summary(rsmModel.2)
# Estimate Std. Error t value Pr(>|t|)
#(Intercept) 73.33875 0.79347 92.4275 1.081e-10 ***
#x1 1.07125 0.56107 1.9093 0.104810
#x2 -3.14688 0.56107 -5.6087 0.001370 **
#x3 -5.15688 0.56107 -9.1911 9.350e-05 ***
#x1:x2 0.35375 0.79347 0.4458 0.671360
#x1:x3 0.01375 0.79347 0.0173 0.986736
#x2:x3 -0.34000 0.79347 -0.4285 0.683246
#x1^2 -4.65813 0.79347 -5.8705 0.001081 **
#x2^2 1.52563 0.79347 1.9227 0.102878
#x3^2 3.00813 0.79347 3.7911 0.009062 **
#---
#Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#Multiple R-squared: 0.9664, Adjusted R-squared: 0.916
#F-statistic: 19.17 on 9 and 6 DF, p-value: 0.0009315
LinearModel.2 <- aov(res ~ x1 + x2 + x3 + I(x1^2) + I(x2^2) + I(x3^2),
data=plancoded)
summary(LinearModel.2 )
AIC(LinearModel.2)
#[1] 61.47997
#valor obtido anteriormente Step: AIC=14.07