Chapter 6

(AST301) Design and Analysis of Experiments II

Author

Md Rasel Biswas

6 The 2k Factorial Design

6.1 Introduction

  • Factorial designs are widely used in experiments involving several factors where it is necessary to study the joint effect of the factors on a response.

  • Chapter 5 presented general methods for the analysis of factorial designs.

  • However, several special cases of the general factorial design are important because they are widely used in research work and also because they form the basis of other designs of considerable practical value.


  • The most important of these special cases is that of k factors, each at only two levels.

  • These levels may be quantitative, such as two values of temperature, pressure, or time; or they may be qualitative, such as two machines, two operators, the “high” and “low” levels of a factor, or perhaps the presence and absence of a factor.

  • A complete replicate of such a design requires 2×2××2=2k observations and is called a 2k factorial design.

  • This chapter focuses on this extremely important class of designs. Throughout this chapter, we assume that

    1. the factors are fixed,
    2. the designs are completely randomized, and
    3. the usual normality assumptions are satisfied.

The 2k design is particularly useful in the early stages of experimental work when many factors are likely to be investigated.

It provides the smallest number of runs with which k factors can be studied in a complete factorial design.

Consequently, these designs are widely used in factor screening experiments (where the experiments is intended in discovering the set of active factors from a large group of factors).

6.2 The 22 design

  • The first design in the 2k series is one with only two factors, say A and B, each run at two levels.

  • This design is called a 22 factorial design.

  • The levels of the factors may be arbitrarily called “low” and “high.”


  • Consider an investigation into the effect of the concentration of the reactant (factor A) and the amount of catalyst (factor B) on the yield in a chemical process.

    • Levels of factor A: 15 and 25 percent
    • Levels of factor B: 1 and 2 pounds
  • The objective of the experiment is to determine if adjustments to either of these two factors would increase the yield.

  • The experiment is replicated three times, so there are 12 runs. The order in which the runs are made is random, so this is a completely randomized experiment.


Data layout:

Graphical view:


By convention, we denote the effect of a factor by a capital Latin letter.

  • “A” refers to the effect of factor A,

  • “B” refers to the effect of factor B, and

  • “AB” refers to the AB interaction.

  • The four treatment combinations in the design are represented by lowercase letters.


  • The high level of any factor in the treatment combination is denoted by the corresponding lowercase letter and that the low level of a factor in the treatment combination is denoted by the absence of the corresponding letter.

  • Thus a represents the treatment combination of A at the high level and B at the low level, b represents A at the low level and B at the high level, and ab represents both factors at the high level.

  • By convention, (1) is used to denote both factors at the low level.

  • This notation is used throughout the 2k series.


  • In a two-level factorial design the average effect of a factor is defined as the change in response produced by a change in the level of that factor averaged over the levels of the other factor.

  • The symbols (1), a, b, and ab represent the total of the response observation at all n replicates taken at the treatment combination.

  • The effect of A at the low level of B is [a(1)]/n, and the effect of A at the high level of B is [abb]/n. Averaging these two quantities yields the main effect of A: A=12{[abb]+[a(1)]n}=12n[ab+ab(1)]


  • The main effect of B is: B=12{[aba]+[b(1)]n}=12n[ab+ba(1)]

  • We define the interaction effect AB as the average difference between the effect of A at the high level of B and the effect of A at the low level of B. Thus, AB=12{[abb][a(1)]n}=12n[ab+(1)ab](6.3)

  • Alternatively, we may define AB as the average difference between the effect of B at the high level of A and the effect of B at the low level of A. This will also lead to Equation 6.3.


A=12(3)(90+1006080)=8.33B=12(3)(90+6010080)=5.00AB=12(3)(90+8010060)=1.67


  • The effect of A (reactant concentration) is positive; this suggests that increasing A from the low level (15%) to the high level (25%) will increase the yield.

  • The effect of B (catalyst) is negative; this suggests that increasing the amount of catalyst added to the process will decrease the yield.

  • The interaction effect appears to be small relative to the two main effects.

The magnitude and direction of factor effects can be used to determine the important factor and ANOVA can generally be used to confirm the interpretation.*

Sum of squares

  • Now we consider determining the sums of squares for A, B, and AB.

  • Note that, in estimating A, a contrast is used: A=12n[ab+ab(1)]=(12n)ContrastA Similarly, B=12n[aba+b(1)]=(12n)ContrastB AB=12n[abab+(1)]=(12n)ContrastAB

  • The three contrasts — ContrastA, ContrastB, and ContrastAB — are orthogonal.


The sum of squares for any contrast is equal to the contrast squared divided by the number of observations in each total in the contrast times the sum of the squares of the contrast coefficients. SSA=(122n)ContrastA2=14n[ab+ab(1)]2


SSA=(122n)ContrastA2=14n[ab+ab(1)]2 SSB=(122n)ContrastB2=14n[aba+b(1)]2 SSAB=(122n)ContrastAB2=14n[abab+(1)]2 Total sum of squares SST=ijkyijk2y24n Error sum of square SSE=SSTSSASSBSSAB


SSA=(122n)ContrastA2=14n[ab+ab(1)]2=208.333 SSB=(122n)ContrastB2=14n[aba+b(1)]2=75 SSAB=(122n)ContrastAB2=14n[abab+(1)]2=8.333 Total sum of squares SST=ijkyijk2y24n=323 Error sum of square SSE=SSTSSASSBSSAB=31.333

Analysis of Variance table

  • On the basis of the p-values, we conclude that the main effects are statistically significant and that there is no interaction between these factors. This confirms our initial interpretation of the data based on the magnitudes of the factor effects.

Standard order of treatment combinations

  • Treatment combinations written in the order (1),a,b,ab is known as standard order or Yates’ order.

  • Using this standard order, we see that the contrast coefficients used in estimating the effects are

  • Note that the contrast coefficients for estimating the interaction effect are just the product of the corresponding coefficients for the two main effects.

Algebraic signs for calculating effects in 22 design

  • The contrast coefficient is always either +1 or −1, and a table of plus and minus signs such as in Table 6.2 can be used to determine the proper sign for each treatment combination

  • The symbol “I” indicates the total or average of the entire experiment.

  • To find the contrast for estimating any effect, simply multiply the signs in the appropriate column of the table by the corresponding treatment combination and add.

    • For example, to estimate A, the contrast is (1)+ab+ab.

  • The contrasts for the effects A,B, and AB are orthogonal. Thus, the 22 (and all 2k designs) is an orthogonal design.

  • The ±1 coding for the low and high levels of the factors is often called the orthogonal coding or the effects coding.

Regression model

  • In a 2k factorial design, it is easy to express the results of the experiment in terms of a regression model.

  • For the chemical process experiment, the regression model is y=β0+β1x1+β2x2+ϵ, where

    • x1 and x2 are the coded variables for the reactant concentration and the amount of catalyst, respectively
    • β’s are regression coefficients

The relationship between the natural variables, the reactant concentration and the amount of catalyst, and the coded variables is x1=Conc(Conclow+Conchigh)/2(ConchighConclow)/2 x2=Catalyst(Catalystlow+Catalysthigh)/2(CatalysthighCatalystlow)/2 


The coded variables are defined as x1=Conc(Conclow+Conchigh)/2(ConchighConclow)/2=Conc205={1if Conc=251if Conc=15 x2=Catalyst(Catalystlow+Catalysthigh)/2(CatalysthighCatalystlow)/2=Catalyst1.50.5={1if Catalyst=21if Catalyst=1 


Regression model fitting in R

# Define the data
y <- c(28, 25, 27, 36, 32, 32, 18, 19, 23, 31, 30, 29)
A <- rep(c(15, 25), each = 3, times = 2)
B <- rep(c(1, 2), each = 6)

# Create the data frame and compute coded variables
dat <- data.frame(A = A, B = B, y = y) |>
  transform(
    A_coded = (A - mean(A)) / abs(diff(range(A)) / 2),
    B_coded = (B - mean(B)) / abs(diff(range(B)) / 2)
  )

print(head(dat))
   A B  y A_coded B_coded
1 15 1 28      -1      -1
2 15 1 25      -1      -1
3 15 1 27      -1      -1
4 25 1 36       1      -1
5 25 1 32       1      -1
6 25 1 32       1      -1

Regression model fitting in R

fit <- lm(y ~ A_coded + B_coded, data = dat)
coef(fit)
(Intercept)     A_coded     B_coded 
  27.500000    4.166667   -2.500000 

The fitted regression model is y^=27.5+4.167x12.5x2y^=27.5+(8.332)x1+(5.002)x2

If you look carefully:

  • Intercept is the grand average of all 12 observations
  • β^1 and β^2 are one-half the corresponding factor effect estimates

Why is the regression coefficients are one half the effect estimates?

Regression coefficient measures the effect of one-unit change in x on y, whereas effect estimate is based on a two-unit change (from −1 to +1)


anova(lm(y ~ A_coded + B_coded, data = dat))
Analysis of Variance Table

Response: y
          Df  Sum Sq Mean Sq F value    Pr(>F)    
A_coded    1 208.333 208.333  47.269 7.265e-05 ***
B_coded    1  75.000  75.000  17.017  0.002578 ** 
Residuals  9  39.667   4.407                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
anova(lm(y ~ A_coded * B_coded, data = dat))
Analysis of Variance Table

Response: y
                Df  Sum Sq Mean Sq F value    Pr(>F)    
A_coded          1 208.333 208.333 53.1915 8.444e-05 ***
B_coded          1  75.000  75.000 19.1489  0.002362 ** 
A_coded:B_coded  1   8.333   8.333  2.1277  0.182776    
Residuals        8  31.333   3.917                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residuals and Model Adequacy

  • The regression model can be used to obtain the predicted or fitted value of y at the four points in the design.

  • Residuals, e=yy^, are:

x1 <- dat$A_coded
x2 <- dat$B_coded
yhat <- 27.5 + (8.33/2)*x1 + (-5/2)*x2
resd <- y - yhat
resd
 [1]  2.165 -0.835  1.165  1.835 -2.165 -2.165 -2.835 -1.835  2.165  1.835
[11]  0.835 -0.165

qqnorm(resd, pch=20, ylim=c(-3.5, 2.5))
qqline(resd, lwd=1.5)


rresd <- sort(resd)
j <- 100*(1:12-.5)/12
plot(rresd,j, pch=20, xlab="residual", ylab="normal prob", 
              ylim=c(0,100), xlim=c(-3.25, 2.25))
abline(lm(j~rresd))


plot(yhat, resd, xlab="Fitted", pch=20, 
 ylab="Residuals", ylim=c(-3.25, 3), xlim=c(20, 35))
abline(h=0, lty=2)

Response surface and contour plot

The regression model y^=27.5+(8.332)x1+(5.002)x2 can be used generate response surface plots.

It is desirable to construct such plots on the natural factor levels than the coded factor levels, so y^=27.5+(8.332)(Conc205)+(5.002)(Catalyst1.50.5)=18.33+0.833Conc5.00Catalyst


res <- lm(y~A+B, data=dat)
res

Call:
lm(formula = y ~ A + B, data = dat)

Coefficients:
(Intercept)            A            B  
    18.3333       0.8333      -5.0000  

conc <- seq(15, 25, length=30)
cata <- seq(1, 2, length=30)
yhatn <- outer(conc, cata, function(x, y) 18.33 + .833*x - 5*y) 
persp(conc, cata, yhatn, theta=130, phi=30, expand=.7,
   zlab="\n\nyhat", xlab="", ylab="", nticks=3, 
col="lightblue",  ticktype="detailed")


contour(conc, cata, yhatn, nlevels=6, xlab="concentration",
        ylab="catalyst")

Example

A router is used to cut registration notches in printed circuit boards. The average notch dimension is satisfactory, but there is too much variability in the process. This excess variability leads to problems in board assembly. A quality control team assigned to this project decided to use a designed experiment to study the process. The team considered two factors: bit size (A) and speed (B).

Two levels were chosen for each factor (bit size A at 1/16 inch and 1/8 inch and speed B at 40 rpm and 80 rpm and a 22 design was set up. Four boards were tested at each of the four runs in the experiment, and the resulting data are shown in the following table:


RunABVibrationTotal1(1)18.218.912.914.464.42a+27.224.022.422.596.13b+15.914.515.114.259.74ab++41.043.936.339.9161.1

  1. Compute the main effects and interaction effect.
  2. Compute the sum of squares associated with the effects.
  3. Construct the ANOVA table and draw conclusion.
  4. Find residuals using regression method.

6.3 The 23 design

The 23 factorial design has three factors (say A, B, and C) and each factor has two levels each. The design has 8 treatment combinations.


  • Standard order (1),a,b,ab,c,ac,bc, and abc.
    • Remember that these symbols also represent the total of all n observations taken at that particular treatment combination.
  • Three different notations for 23 design:

Effects in the 23 design

  • Main effects: A, B, and C

  • Two-factor interactions: AB, AC, BC

  • Three-factor interaction: ABC



The A effect is just the average of the four runs where A is at the high level (y¯A+) minus the average of the four runs where A is at the low level (y¯A), A=y¯A+y¯A=a+ab+ac+abc4n(1)+b+c+bc4n

This equation can be rearranged as A=14n[a+ab+ac+abc(1)bcbc]

Similarly B=14n[b+ab+bc+abc(1)acac]C=14n[c+ac+bc+abc(1)abab]

The quantities in brackets are contrasts in the treatment combinations

Table of plus and minus signs for calculating effects

  • The column for A,B, abd C are actually from the design matrix.

  • This table actually contains all the contrasts.


Construction of plus and minus table:

  1. Signs for the main effects are determined by associating a plus with the high level and a minus with the low level.

  2. Once the signs for the main effects have been established, the signs for the remaining columns can be obtained by multiplying the appropriate preceding columns


Interesting properties of Table of plus and minus signs:

  1. Except the column I, every column has an equal number of + and signs

  2. The sum of the products of any two columns is zero

  3. The column I multiplied any column leaves the column unchanged, column I is known as identity column

  4. Product of any two columns yields a column in the table, e.g.  A×B=AB,AB×BC=AB2C=AC(mod 2).

Exponents in the products are formed by using modulus 2 arithmetic.

Property-2 indicates that it is an Orthogonal design

Sum of squares

In the 23 design with n replicates, the sum of squares for any effect is SS=Contrast223n=Contrast28n

The 23 design: An example

A soft drink bottler is interested in obtaining more uniform fill heights in the bottles produced his manufacturing process.

The filling machine theoretically fills fills each bottle to the correct target height, but in practice, there is variation around this target.

The bottler would like to understand better the sources of variability and eventually reduce it.

The process engineer can control three factors during the filling process: percentage of carbonation (A), operating pressure (B), and line speed (C).

Each factor has two levels: A (10% and 12%), B (25 psi and 30 psi), and C (200 b/min and 300 b/min).


The data:

Notation for the response: yijkl,i,j,k,l=1,2


Estimation of effects

Main effect of A A=(abc+ab+ac+abcbc(1))/4n=(11+5+3+12+1+1+4)/8=24/8=3 Similarly, B=(abc+ab+bc+bacac(1))/4n=2.25 C=(abc+ac+bc+cabab(1))/4n=1.75


Interactions AB=(abc+ab+c+(1)acbcab)/4n=0.75 AC=(abc+ac+b+(1)abbcac)/4n=0.25 BC=(abc+bc+a+(1)abacbc)/4n=0.5 ABC=(abc+a+b+cabacbc(1))/4n=0.5

Sum of squares

SSA=ContrastA28n=24216=36SSAB=6216=2.25 SSB=18216=20.25SSAC=2216=0.25 SSC=14216=12.25SSBC=4216=1 SSABC=4216=1


Percentage contribution is a rough but effective guide to the relative importance of each model term. Main effects dominate the process accounting for over 87 percent of the total variation.

Analysis of variance table

All the main effects are highly significant and only the interaction between carbonation and pressure is significant at about 10 percent level of significance.

Regression model

The fitted regression model for the design is y^=1+(32)xA+(2.252)xB+(1.752)xC+(0.752)xAxB=1+(32)carb111.0+(2.252)pres27.52.5+(1.752)speed25050+(0.752)(carb111.0)(pres27.52.5) y^=9.625+2.62carb1.20pres+0.035speed+0.38carb×speed


The model sum of squares is SSModel =SSA+SSB+SSC+SSAB+SSAC+SSBC+SSABC

Thus the statistic F0=MSModel MSE is testing the hypotheses H0:β1=β2=β3=β12=β13=β23=β123=0 H1 : at least one β0

If F0 is large, we would conclude that at least one variable has a nonzero effect. Then each individual factorial effect is tested for significance using the F statistic.


R2=SSModel SSTotal  It measures the proportion of total variability explained by the model.

A potential problem with this statistic is that it always increases as factors are added to the model, even if these factors are not significant. The adjusted R2 statistic, defined as RAdj 2=1SSE/dfESSTotal /dfTotal 


RAdj 2 is a statistic that is adjusted for the “size” of the model, that is, the number of factors.

The adjusted R2 can actually decrease if nonsignificant terms are added to a model. The standard error of each coefficient, defined as se(β^)=V(β^)=MSEn2k=MSEN


The 95 percent confidence intervals on each regression coefficient are computed from β^t0.025,Npse(β^)ββ^+t0.025,Npse(β^) where the degrees of freedom on t are the number of degrees of freedom for error; that is, N is the total number of runs in the experiment (16), and p is the number of model parameters (8).

Other Methods for Judging the Significance of Effects.

The analysis of variance is a formal way to determine which factor effects are nonzero. Several other methods are useful. Now, we show how to calculate the standard error of the effects, and we use these standard errors to construct confidence intervals on the effects.

Confidence Interval of the Effect:

The 100(1α) percent confidence intervals on the effects are computed from Effect±tα/2, Npse(Effect), where se(Effect)=2Sn2k,whereS2=MSE

Regression analysis with R

# Define the response variable
y3 <- c(-3, 0, -1, 2, -1, 2, 1, 6,
        -1, 1, 0, 3, 0, 1, 1, 5)

# Create treatment variables
xA <- rep(c(-1, 1), each = 1, times = 8)
xB <- rep(c(-1, 1), each = 2, times = 4)
xC <- rep(c(-1, 1), each = 4, times = 2)

# Fit the linear model
reg.y3 <- lm(y3 ~ xA + xB + xC + xA:xB)
coef(reg.y3)
(Intercept)          xA          xB          xC       xA:xB 
      1.000       1.500       1.125       0.875       0.375 

anova(reg.y3)
Analysis of Variance Table

Response: y3
          Df Sum Sq Mean Sq F value    Pr(>F)    
xA         1  36.00  36.000 54.6207 1.376e-05 ***
xB         1  20.25  20.250 30.7241 0.0001746 ***
xC         1  12.25  12.250 18.5862 0.0012327 ** 
xA:xB      1   2.25   2.250  3.4138 0.0916999 .  
Residuals 11   7.25   0.659                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual analysis

library(broom)
ggplot(augment(reg.y3)) +
  geom_point(aes(.fitted, .resid), size = 2) +
  labs(x = "fitted", y = "residuals")


ggplot(augment(reg.y3)) +
  geom_point(aes(xA, .resid), size = 2) +
  labs(x = "Carbonation", y = "residuals") 


ggplot(augment(reg.y3)) +
  geom_point(aes(xB, .resid), size = 2) +
  labs(x = "Pressure", y = "residuals") 


qqnorm(residuals(reg.y3))
qqline(residuals(reg.y3))

Full model vs our model

dat2 <- data.frame(y=y3, x1=xA, x2=xB, x3=xC)
head(dat2)
   y x1 x2 x3
1 -3 -1 -1 -1
2  0  1 -1 -1
3 -1 -1  1 -1
4  2  1  1 -1
5 -1 -1 -1  1
6  2  1 -1  1

res2 <- lm(y~xA*xB*xC, data=dat2)
anova(res2)
Analysis of Variance Table

Response: y
          Df Sum Sq Mean Sq F value    Pr(>F)    
xA         1  36.00  36.000    57.6 6.368e-05 ***
xB         1  20.25  20.250    32.4 0.0004585 ***
xC         1  12.25  12.250    19.6 0.0022053 ** 
xA:xB      1   2.25   2.250     3.6 0.0943498 .  
xA:xC      1   0.25   0.250     0.4 0.5447373    
xB:xC      1   1.00   1.000     1.6 0.2415040    
xA:xB:xC   1   1.00   1.000     1.6 0.2415040    
Residuals  8   5.00   0.625                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

res3 <- lm(y~xA+xB+xC+xA:xB, data=dat2)
anova(res3)
Analysis of Variance Table

Response: y
          Df Sum Sq Mean Sq F value    Pr(>F)    
xA         1  36.00  36.000 54.6207 1.376e-05 ***
xB         1  20.25  20.250 30.7241 0.0001746 ***
xC         1  12.25  12.250 18.5862 0.0012327 ** 
xA:xB      1   2.25   2.250  3.4138 0.0916999 .  
Residuals 11   7.25   0.659                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

anova(res3, res2)
Analysis of Variance Table

Model 1: y ~ xA + xB + xC + xA:xB
Model 2: y ~ xA * xB * xC
  Res.Df  RSS Df Sum of Sq   F Pr(>F)
1     11 7.25                        
2      8 5.00  3      2.25 1.2   0.37

6.4 The general 2k design

The general 2k design

  • The 2k factorial design is a design with k factors each has two levels.

  • A statistical model for 2k design would include

    • k main effects
    • (k2) two-factor interactions
    • (k3) three-factor interactions
    • one k-factor interaction
  • For a 2k design, the complete model would contain 2k1 effects

  • The treatment combinations can be written in a standard order, e.g.
    (1)ababcacbcabcdad


  • The complete model for 2k design with n replications has
    • n2k1 total degrees of freedom
    • (n2k1)(2k1)=2k(n1) error degrees of freedom
  • For a 2k design, contrast for the effect ABK can be expressed as ContrastAB=(a±1)(b±1)(k±1)
    • ordinary algebra is used with “1” being replaced by (1) in the final expression.
    • The sign in each set of parentheses is negative if the factor is included in the effect and positive if the factor is not included.
  • E.g. for a 22 design, the contrast A=(a1)(b+1)=ab+ab(1)AB=(a1)(b1)=abab+(1)

  • Estimate of the contrast ABK=2n2k[ContrastABK]

  • Sums of squares SSABK=1n2k[ContrastABK]2, where n is the number of replications.



6.5 A single replicate of the 2k design

  • Total number of treatment combinations in a 2k factorial design could be very large even for a moderate number of factors

  • For example, a 25 design has 32 treatment combinations, a 26 design has 64 treatment combinations, and so on

  • In many practical situations, the available resources may only allow a single replicate of the design to be run

  • Single replicate may cause problem if the response is highly variable

  • A single replicate of a 2k design is sometime called an unreplicated factorial


  • With only one replicate, pure error cannot be estimated, so commonly used analysis of variance cannot be performed

  • Two approaches are commonly used for analysing unreplicated factorial design

  1. Consider certain high-order interactions as negligible and combine their mean squares to estimate the error.
    • This approach is based on the assumption that the most systems is dominated by some of the main effects and low-order interactions, and most of the high-order interactions are negligible (sparsity of effects principle)

  1. Higher-order interactions could be of interest, in that case polling higher-order interactions to estimate the error variance is not appropriate.
    • In such case, normal probability plots of the effect estimates could be of help. The negligible effects should be normally distributed with mean 0 and variance σ2 and will fall in a straight line on the plot. On the other hand, significant effects will have nonzero means and will not lie along the straight line.

EXAMPLE 6.2

A chemical product is produced in a pressure vessel. A factorial experiment is carried out in the pilot plant to study the factors thought to influence the filtration rate of this product.

Four factors temperature (A), pressure (B), concentration of formaldehyde (C), and stirring rate (D) are thought to be important for the chemical product.

The design matrix and the response data obtained from a single replicate of the 24 experiment are shown in Table 6.10.



  • We will begin the analysis of these data by constructing a normal probability plot of the effect estimates.

    • The table of plus and minus signs for the contrast constants for the 24 design are shown in Table 6.11.

    • From these contrasts, we may estimate the 15 factorial effects and the sums of squares shown in Table 6.12.




df <- data.frame(
  y  = c(45, 71, 48, 65, 68, 60, 80, 65, 43, 100, 45, 104, 75, 86, 70, 96),
  A = rep(c(-1, 1), times = 8),
  B = rep(c(-1, 1), each = 2, times = 4),
  C = rep(c(-1, 1), each = 4, times = 2),
  D = rep(c(-1, 1), each = 8)
)
model <- lm(y ~ A * B * C * D, data = df)
dat6b <- tibble(
  `Model terms` = c('A', 'B', 'C', 'D', 'AB', 'AC', 'BC',
                    'AD', 'BD', 'CD', 'ABC', 'ABD', 
                    'ACD', 'BCD', 'ABCD'),
  `Effect estimates` = coef(model)[-1] * 2,
   SS = anova(model)$"Sum Sq"[1:15],
  `Percentage contribution` = 100 * (SS / sum(SS))
)

kableExtra::kable(dat6b, digits = 3, align = 'c')
Model terms Effect estimates SS Percentage contribution
A 21.625 1870.562 32.640
B 3.125 39.062 0.682
C 9.875 390.063 6.806
D 14.625 855.563 14.929
AB 0.125 0.062 0.001
AC -18.125 1314.062 22.929
BC 2.375 22.562 0.394
AD 16.625 1105.562 19.291
BD -0.375 0.563 0.010
CD -1.125 5.063 0.088
ABC 1.875 14.063 0.245
ABD 4.125 68.062 1.188
ACD -1.625 10.563 0.184
BCD -2.625 27.563 0.481
ABCD 1.375 7.563 0.132

  • The important effects that emerge from this analysis are

    • the main effects of A,C, and D and

    • the AC and AD interactions.


library(ggDoE)
main_effects(df, response='y', exclude_vars = c('B'),
             color_palette = 'viridis', n_columns=3)

Main effect plots

  • The main effects of A, C, and D are plotted in Figure. All three effects are positive, and if we considered only these main effects, we would run all three factors at the high level to maximize the filtration rate.

  • However, it is always necessary to examine any interactions that are important. Remember that main effects do not have much meaning when they are involved in significant interactions.


p1=interaction_effects(df, response='y',exclude_vars=c('B','D'))
p2=interaction_effects(df, response='y',exclude_vars=c('B','C'))
gridExtra::grid.arrange(p1, p2, ncol = 2)

Interaction plots

The AC interaction indictates: the A effect is very small when the C is at the high level and very large when the C is at the low level, with the best results obtained with low C and high A.

The AD interaction indicates: D has little effect at low A but a large positive effect at high A.

Therefore, the best filtration rates would appear to be obtained when A and D are at the high level and C is at the low level. This would allow the reduction of the formaldehyde concentration to a lower level, another objective of the experimenter.

Design projection

  • Another interpretation of the effects in Figure 6.11 is possible

  • Because B (pressure) is not significant and all interactions involving B are negligible, we may discard B from the experiment so that the design becomes a 23 factorial in A,C, and D with two replicates.

  • This is easily seen from examining only columns A,C, and D in the design matrix shown in Table 6.10 and noting that those columns form two replicates of a 23 design.



The analysis of variance for the data using this simplifying assumption is summarized in Table 6.13.

The conclusions that we would draw from this analysis are essentially unchanged from those of Example 6.2.

Note that by projecting the single replicate of the 24 into a replicated 23 , we now have both an estimate of the ACD interaction and an estimate of error based on what is sometimes called hidden replication

In general, if we have a single replicate of a 2k design, and if h(h<k) factors are negligible and can be dropped, then the original data correspond to a full two-level factorial in the remaining kh factors with 2h replicates.


The Half-Normal Plot of Effects

  • An alternative to the normal probability plot of the factor effects is the half-normal plot.

  • This is a plot of the absolute value of the effect estimates against their cumulative normal probabilities.

  • The straight line on the half-normal plot always passes through the origin and should also pass close to the fiftieth percentile data value.


ggDoE::half_normal(model)

Other Methods for Analyzing Unreplicated Factorials.

A widely used analysis procedure for an unreplicated two-level factorial design is the normal (or half-normal) plot of the estimated factor effects.

However, unreplicated designs are so widely used in practice that many formal analysis procedures have been proposed to overcome the subjectivity of the normal probability plot.

Hamada and Balakrishnan (1998) compared some of these methods.

  • They found that the method proposed by Lenth (1989) has good power to detect significant effects. It is also easy to implement, and as a result it appears in several software packages for analyzing data from unreplicated factorials.

6.6 Additional Examples of Unreplicated 2k Designs

EXAMPLE 6.3: Data Transformation in a Factorial Design

6.7 2k Designs are Optimal Designs

The model parameter regression coefficients (and effect estimates) from a 2k design are least squares estimates. For a 22 model, the regression model is y=β0+β1x1+β2x2+β12x1x2+ε

The four observations from a 22 design: (1)=β0+β1(1)+β2(1)+β12(1)(1)+ε1a=β0+β1(1)+β2(1)+β12(1)(1)+ε2b=β0+β1(1)+β2(1)+β12(1)(1)+ε3ab=β0+β1(1)+β2(1)+β12(1)(1)+ε1

y=Xβ+ε,y=[(1)abab],X=[1111111111111111],β=[β0β1β2β12],ε=[ε1ε2ε3ε4]


The least squares estimate of β is given by: β^=(XX)1Xy

Since this is an orthogonal design, the XX matrix is diagonal:

β^=[4000040000400004]1[(1)+a+b+aba+abb(1)b+aba(1)(1)ab+ab]


With this, we obtain:

[β^0β^1β^2β^12]=14I4[(1)+a+b+aba+abb(1)b+aba(1)(1)ab+ab]=[(1)+a+b+ab4a+abb(1)4b+aba(1)4(1)ab+ab4]

  • The “usual” contrasts are shown in the matrix of Xy.
  • The XX matrix is diagonal as a consequence of the orthogonal design.
  • The regression coefficient estimates are exactly half of the “usual” effect estimates.

The matrix (X’X) has some useful properties

V(β^)=σ2(diagonal element of (XX)1)=σ24Minimum possible value for a four-run design

|XX|=256Maximum possible value for a four-run design

Notice that these results depend on both the design you have chosen and the model.


It turns out that the volume of the joint confidence region that contains all the model regression coefficients is inversely proportional to the square root of the determinant of XX.

Therefore, to make this joint confidence region as small as possible, we would want to choose a design that makes the determinant of XX as large as possible.

In general, a design that minimizes the variance of the model regression coefficients (or maximize the determinant of XX) is called a D-optimal design.

The 2k design is a D-optimal design for fitting the first-order model or the first-order model with interaction.

6.8 The Addition of Center Points to the 2k Design

A potential concern in the use of two-level factorial designs is the assumption of linearity in the factor effects.

First-order model (with interaction): y=β0+j=1kβjxj+i<jβijxixj+ϵ.(6.28) is capable of representing some curvature in the response function.

Second-order model: y=β0+j=1kβjxj+i<jβijxixj+j=1kβijxj2+ϵ(6.29) where βjj represent pure Second-order or quadratic effects.


In running a two-level factorial experiment, we usually anticipate fitting the first-order model in Equation 6.28, but we should be alert to the possibility that the second-order model in Equation 6.29 is more appropriate.

There is a method of replicating certain points in a 2k factorial that will provide protection against curvature from second-order effects as well as allow an independent estimate of error to be obtained.

The method consists of adding center points to the 2k design. These consist of nC replicates run at the points xi=0(i=1,2,,k).

One important reason for adding the replicate runs at the design center is that center points do not affect the usual effect estimates in a 2k design.

When we add center points, we assume that the k factors are quantitative.



Let y¯F be the average of the nF runs at the four factorial points, and y¯C be the average of the nC runs at the center point.

y¯F = y¯C no “curvature” H0:j=1kβjj=0H1:j=1kβjj0 SSPure quadratic =nFnC(y¯Fy¯C)2nF+nC(6.30) The sum of square has a single degree of freedom.


This sum of squares may be incorporated into the ANOVA and may be compared to the error mean square to test for pure quadratic curvature.

Furthermore, if the factorial points in the design are unreplicated, one may use the nC center points to construct an estimate of error with nC1 degrees of freedom.

Example 6.7 (Extended 6.2)

We will illustrate the addition of center points to a 2k design by reconsidering the pilot plant experiment in Example 6.2.

Recall that this is an unreplicated 24 design.

Refer to the original experiment shown in Table 6.10.



Suppose that four center points are added to this experiment, and at the points x1=x2=x3=x4=0 the four observed filtration rates were 73,75,66, and 69.

  • The average of these four center points is y¯C=70.75
  • The average of the 16 factorial runs is y¯F=70.06.

Since y¯C and y¯F are very similar, we suspect that there is no strong curvature present.


The mean square for pure error is calculated from the center points as follows: MSE=SSEnC1=Center points (yiy¯c)2nC1=i=14(yi70.75)241=16.25


The difference y¯Fy¯C=70.0670.75=0.69 is used to compute the pure quadratic (curvature) sum of squares from Equation 6.30 as follows: SSPure quadratic =nFnC(y¯Fy¯C)2nF+nC=(16)(4)(0.69)216+4=1.51


The upper portion of the Table 6.24 shows ANOVA for the full model.


The ANOVA indicates that there is no evidence of second-order curvature in the response over the region of exploration (p-value=0.7802).

That is, the null hypothesis H0:β11+β22+ β33+β44=0 cannot be rejected.

The significant effects are A,C,D,AC, and AD.


The ANOVA for the reduced model is shown in the lower portion of Table 6.24.

The results of this analysis agree with those from Example 6.2, where the important effects were isolated using the normal probability plotting method.