Voicethread 10: RSM

x <- read.csv("~/Desktop/Listeria+Monocytogenes.csv")
x
##    Run X1.Conc X2.Conc Time Listeria.count S.N.ratio
## 1    1       1       0    1          6.613     16.41
## 2    2       1       0    2          6.618     16.41
## 3    3       1       0    3          6.776     16.62
## 4    4       1       0    4          6.769     16.61
## 5    5       2       0    1          6.518     16.28
## 6    6       2       0    2          6.542     16.31
## 7    7       2       0    3          6.406     16.13
## 8    8       2       0    4          6.263     15.94
## 9    9       3       0    1          6.457     16.20
## 10  10       3       0    2          6.183     16.01
## 11  11       3       0    3          6.543     16.20
## 12  12       3       0    4          6.612     16.41
## 13  13       4       0    1          6.318     16.01
## 14  14       4       0    2          6.559     16.34
## 15  15       4       0    3          6.294     15.98
## 16  16       4       0    4          6.375     16.09
## 17  17       0       1    1          6.613     16.41
## 18  18       0       1    2          6.618     16.41
## 19  19       0       1    3          6.776     16.62
## 20  20       0       1    4          6.769     16.61
## 21  21       0       2    1          6.474     16.22
## 22  22       0       2    2          6.402     16.13
## 23  23       0       2    3          6.573     16.36
## 24  24       0       2    4          6.586     16.37
## 25  25       0       3    1          6.338     16.04
## 26  26       0       3    2          6.639     16.44
## 27  27       0       3    3          6.489     16.24
## 28  28       0       3    4          6.663     16.47
## 29  29       0       4    1          6.498     16.26
## 30  30       0       4    2          6.474     16.22
## 31  31       0       4    3          6.575     16.36
## 32  32       0       4    4          6.573     16.36
rsm1 <- rsm(Listeria.count ~ Time + FO(X1.Conc,X2.Conc), data = x)
summary(rsm1)
## 
## Call:
## rsm(formula = Listeria.count ~ Time + FO(X1.Conc, X2.Conc), data = x)
## 
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   6.6147     0.0710   93.13  < 2e-16 ***
## Time          0.0341     0.0192    1.78  0.08545 .  
## X1.Conc      -0.0850     0.0207   -4.11  0.00031 ***
## X2.Conc      -0.0524     0.0207   -2.53  0.01724 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Multiple R-squared:  0.422,  Adjusted R-squared:  0.36 
## F-statistic:  6.8 on 3 and 28 DF,  p-value: 0.00138
## 
## Analysis of Variance Table
## 
## Response: Listeria.count
##                      Df Sum Sq Mean Sq F value Pr(>F)
## Time                  1  0.047  0.0466    3.18 0.0855
## FO(X1.Conc, X2.Conc)  2  0.253  0.1264    8.61 0.0012
## Residuals            28  0.411  0.0147               
## Lack of fit           5  0.111  0.0223    1.71 0.1723
## Pure error           23  0.300  0.0130               
## 
## Direction of steepest ascent (at radius 1):
## X1.Conc X2.Conc 
## -0.8514 -0.5245 
## 
## Corresponding increment in original units:
## X1.Conc X2.Conc 
## -0.8514 -0.5245
contour(rsm1, ~X1.Conc+X2.Conc, image=TRUE, at=summary(rsm1$canonical$xs))

plot of chunk unnamed-chunk-2

persp(rsm1, X1.Conc ~ X2.Conc, zlab="Listeria Count",  contours = "colors", theta=65)

plot of chunk unnamed-chunk-2

rsm2 <- rsm(Listeria.count ~ Time + SO(X1.Conc,X2.Conc), data = x)
summary(rsm2)
## 
## Call:
## rsm(formula = Listeria.count ~ Time + SO(X1.Conc, X2.Conc), data = x)
## 
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   6.8539     0.1207   56.78   <2e-16 ***
## Time          0.0341     0.0180    1.90   0.0689 .  
## X1.Conc      -0.3165     0.1066   -2.97   0.0063 ** 
## X2.Conc      -0.2993     0.1066   -2.81   0.0093 ** 
## X1.Conc^2     0.0455     0.0220    2.07   0.0484 *  
## X2.Conc^2     0.0502     0.0220    2.28   0.0309 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Multiple R-squared:  0.526,  Adjusted R-squared:  0.435 
## F-statistic: 5.77 on 5 and 26 DF,  p-value: 0.00104
## 
## Analysis of Variance Table
## 
## Response: Listeria.count
##                      Df Sum Sq Mean Sq F value  Pr(>F)
## Time                  1  0.047  0.0466    3.60 0.06889
## FO(X1.Conc, X2.Conc)  2  0.253  0.1264    9.76 0.00069
## PQ(X1.Conc, X2.Conc)  2  0.074  0.0371    2.86 0.07528
## Residuals            26  0.337  0.0130                
## Lack of fit           3  0.037  0.0124    0.95 0.43158
## Pure error           23  0.300  0.0130                
## 
## Stationary point of response surface:
## X1.Conc X2.Conc 
##   3.476   2.984 
## 
## Eigenanalysis:
## $values
## [1] 0.05016 0.04553
## 
## $vectors
##         [,1] [,2]
## X1.Conc    0   -1
## X2.Conc    1    0
contour(rsm2, ~X1.Conc+X2.Conc, image=TRUE, at=summary(rsm2$canonical$xs))

plot of chunk unnamed-chunk-2

persp(rsm2, X1.Conc ~ X2.Conc, zlab="Listeria Count",  contours = "colors", theta=65)

plot of chunk unnamed-chunk-2