Mixture Designs

Rahma Anisa

2021-11-22

Seluruh materi dalam modul ini diambil dari Lawson (2014).

Creating Mixture Designs in R

Rancangan simplex-lattice pada R software dapat dilakukan menggunakan fungsi SLD(), sedangkan rancangan simplex-centroid menggunakan fungsi SCD().

#install.packages("mixexp")
library(mixexp)
SLD(3,2)
##    x1  x2  x3
## 1 1.0 0.0 0.0
## 2 0.5 0.5 0.0
## 3 0.0 1.0 0.0
## 4 0.5 0.0 0.5
## 5 0.0 0.5 0.5
## 6 0.0 0.0 1.0
SCD(4)
##           x1        x2        x3        x4
## 1  1.0000000 0.0000000 0.0000000 0.0000000
## 2  0.0000000 1.0000000 0.0000000 0.0000000
## 3  0.0000000 0.0000000 1.0000000 0.0000000
## 4  0.0000000 0.0000000 0.0000000 1.0000000
## 5  0.5000000 0.5000000 0.0000000 0.0000000
## 6  0.5000000 0.0000000 0.5000000 0.0000000
## 7  0.5000000 0.0000000 0.0000000 0.5000000
## 8  0.0000000 0.5000000 0.5000000 0.0000000
## 9  0.0000000 0.5000000 0.0000000 0.5000000
## 10 0.0000000 0.0000000 0.5000000 0.5000000
## 11 0.3333333 0.3333333 0.3333333 0.0000000
## 12 0.3333333 0.3333333 0.0000000 0.3333333
## 13 0.3333333 0.0000000 0.3333333 0.3333333
## 14 0.0000000 0.3333333 0.3333333 0.3333333
## 15 0.2500000 0.2500000 0.2500000 0.2500000

Secar visual rancangan SLD{3,3} dapat ditampilkan menggunakan fungsi DesignPoints().

des<-SLD(3,3)
DesignPoints(des)

Analysis of Mixture Experiments

Analisis dapat dilakukan menggunakan package daewr.

#install.packages("daewr")
library(daewr)
data(pest)
pest
##         x1      x2      x3    y
## 1  1.00000 0.00000 0.00000 48.7
## 2  0.80000 0.10000 0.10000 49.5
## 3  0.60000 0.20000 0.20000 50.2
## 4  0.50000 0.00000 0.50000 52.8
## 5  0.50000 0.50000 0.00000 49.3
## 6  0.33333 0.33333 0.33333 51.1
## 7  0.30000 0.20000 0.50000 52.7
## 8  0.30000 0.50000 0.20000 50.3
## 9  0.10000 0.10000 0.80000 60.7
## 10 0.10000 0.80000 0.10000 49.9
## 11 0.00000 0.00000 1.00000 64.9
## 12 0.00000 0.50000 0.50000 53.5
## 13 0.00000 1.00000 0.00000 50.6
DesignPoints(pest)
## Warning: the design matrix has more than three columns; the DesignPoints function  
## only plots design points for designs with three mixture components. Component x1 is 
## assumed to to be the first column of the design, x2 the second and x3 the third. Other 
## columns are ignored. Use cornerlabs and axislabs to change variable names in the plot.

Fungsi lm() dapat digunakan untuk menyusun model dengan pendekatan kuadrat terkecil. Berikut ini adalah contoh perenapan special cubic model menggunakan fungsi lm().

spc <- lm(y ~ x1 + x2 + x3 + x1:x2 + x1:x3 + x2:x3 + x1:x2:x3 + -1, data = pest)
summary(spc)
## 
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x1:x2 + x1:x3 + x2:x3 + x1:x2:x3 + 
##     -1, data = pest)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.6134 -0.2553 -0.1051  0.2049  1.1253 
## 
## Coefficients:
##          Estimate Std. Error t value Pr(>|t|)    
## x1        48.9056     0.5645  86.628 1.59e-10 ***
## x2        50.3951     0.5685  88.644 1.39e-10 ***
## x3        65.3870     0.5685 115.014 2.91e-11 ***
## x1:x2     -0.9156     3.0422  -0.301  0.77360    
## x1:x3    -16.3642     3.0422  -5.379  0.00170 ** 
## x2:x3    -17.1440     3.0888  -5.550  0.00145 ** 
## x1:x2:x3   3.1052    18.0351   0.172  0.86896    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.6317 on 6 degrees of freedom
## Multiple R-squared:  0.9999, Adjusted R-squared:  0.9999 
## F-statistic: 1.299e+04 on 7 and 6 DF,  p-value: 4.146e-12

Berikut ini adalah contoh apabila ingin menerapkan model kuadratik Scheffe pada data tersebut.

qm <- lm(y ~ x1 + x2 + x3 + x1:x2 + x1:x3 + x2:x3 -1,data=pest)

summary(qm)
## 
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x1:x2 + x1:x3 + x2:x3 - 1, data = pest)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.5836 -0.2657 -0.1495  0.2168  1.1214 
## 
## Coefficients:
##       Estimate Std. Error t value Pr(>|t|)    
## x1     48.8934     0.5198  94.061 4.04e-12 ***
## x2     50.3832     0.5237  96.202 3.46e-12 ***
## x3     65.3751     0.5237 124.827 5.58e-13 ***
## x1:x2  -0.6644     2.4776  -0.268 0.796309    
## x1:x3 -16.1130     2.4776  -6.504 0.000333 ***
## x2:x3 -16.9186     2.5964  -6.516 0.000329 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.5863 on 7 degrees of freedom
## Multiple R-squared:  0.9999, Adjusted R-squared:  0.9999 
## F-statistic: 1.759e+04 on 6 and 7 DF,  p-value: 2.937e-14

Menurut Lawson (2014), pendekatan fungsi lm() tidak menghasilkan analisa yang tepat apabila model disusun tanpa intercept. Salah satu cara untuk mengoreksinya dengan tetap menggunakan fungsi lm() adalah dengan menyertakan intersep dan mengeluarkan \(x_3\) dari model sebelumnya.

fm <- lm(y ~ x1 + x2 + x1:x2 + x1:x3 + x2:x3, data = pest)

summary(fm)
## 
## Call:
## lm(formula = y ~ x1 + x2 + x1:x2 + x1:x3 + x2:x3, data = pest)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.5834 -0.2656 -0.1494  0.2167  1.1215 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  65.3752     0.5237 124.826 5.59e-13 ***
## x1          -16.4817     0.7235 -22.780 7.96e-08 ***
## x2          -14.9919     0.7286 -20.575 1.61e-07 ***
## x1:x2        -0.6649     2.4776  -0.268 0.796166    
## x1:x3       -16.1135     2.4776  -6.504 0.000333 ***
## x2:x3       -16.9192     2.5965  -6.516 0.000329 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.5863 on 7 degrees of freedom
## Multiple R-squared:  0.9913, Adjusted R-squared:  0.9852 
## F-statistic: 160.4 on 5 and 7 DF,  p-value: 4.631e-07

Berdasarkan output di atas, terlihat bahwa \(R^2\) yang dihasilkan tidak lebih besar dibandingkan dengan model kuadratik.

Perhitungan corrected \(R^2\) dapat dilakukan dengan fungsi MixModel() berikut ini.

MixModel(pest, "y",c("x1","x2","x3"),2)
##      
##       coefficients   Std.err     t.value         Prob
## x1      48.8934291 0.5198095  94.0602787 4.044320e-12
## x2      50.3832671 0.5237302  96.2008061 3.455458e-12
## x3      65.3751660 0.5237302 124.8260389 5.586642e-13
## x2:x1   -0.6647398 2.4775878  -0.2683012 7.962022e-01
## x3:x1  -16.1133712 2.4775878  -6.5036530 3.329877e-04
## x2:x3  -16.9190175 2.5964516  -6.5162076 3.290837e-04
##      
## Residual standard error:  0.5862886  on  7 degrees of freedom 
## Corrected Multiple R-squared:  0.9913463
## 
## Call:
## lm(formula = mixmodnI, data = frame)
## 
## Coefficients:
##       x1        x2        x3     x1:x2     x1:x3     x2:x3  
##  48.8934   50.3832   65.3751   -0.6644  -16.1130  -16.9186

Setelah diperoleh model yang pas, terdapat beberapa cara untuk mengeksplorasi fitted surface, salah satunya adalah menggunakan fungsi MixturePlot().

data(pest)
MixturePlot(des=pest, mod=2)

Fungsi EffPlot() dapat digunakan untuk membuat Effect Plot seperti di bawah ini.

EffPlot(des=pest, mod=2, dir=1)

Effect Plot dapat dimanfaatkan mengidentifikasi tingkat kepentingan komponen yang digunakan dalam percobaan. Komponen yang lebih penting akan memiliki bentuk kurva yang cenderung lebih curang, sebaliknya, komponen yang kurang penting akan membentuk kurva dengan kemiringan yang relatif datar.

Penjelasan lebih lanjut dapat dipelajari pada Lawson (2014), yaitu mengenai:

  • Constrained mixture experiments

  • Blocking mixture experiments

  • Mixture experiments with process variables

  • Mixture experiments in split-plot arrangements

REFERENCE

Lawson, J. (2014). Design and Analysis of Experiments with R (Vol. 115). CRC press.