Skip to main content

Designs with Factors at Three Levels

  • Chapter
  • First Online:
Experimental Design

Abstract

Sometimes, we wish to examine the impact of a factor at three levels rather than at two levels as discussed in previous chapters. For example, to determine the differences in quality among three suppliers, one would consider the factor “supplier” at three levels. However, for factors whose levels are measured on a numerical scale, there is a major and conceptually-different reason to use three levels: to be able to study not only the linear impact of the factor on the response (which is all that can be done when studying a factor that has only two levels), but also the nonlinear impact. The basic analysis-of-variance technique treats the levels of a factor as categorical, whether they actually are or not. One (although not the only) logical and useful way to orthogonally break down the sum of squares associated with a numerical factor is to decompose it into a linear effect and a quadratic effect (for a factor with three numerical levels), a linear effect, a quadratic effect, and a cubic effect (for a factor with four numerical levels), and so forth.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Notes

  1. 1.

    We especially recommend Applied Factorial and Fractional Systems by R. McLean and V. Anderson , New York, Marcel Dekker, 1984.

  2. 2.

    In essence, we are taking the change in yield as we go up a level of A from low to medium, and then the change in yield as we go up to the next level of A (i.e., from medium to high) – both linear effects, and “averaging” them – except that, by tradition, we do not bother with a denominator at this time. The appropriate denominator will be prominently discussed later.

  3. 3.

    Just as we need two points to define a straight line, we require three points to define a quadratic function – defined to be a polynomial in which the highest power (exponent) is 2. Given that we have limited ourselves in this section to factors with three levels, we can determine the presence (or absence) of curvature to be ascribed solely to a quadratic (“squared”) term. Thus, for a three-level factor’s impact on yield, the term quadratic may be accurately viewed as a synonym for nonlinear ; the restriction of nonlinear behavior to the quadratic category is due to a limitation of the model, not to a statement of knowledge. In practice, this issue pertains more to mathematical completeness than to a limitation in the usefulness of the results. One can investigate models constructed of higher-order polynomials by including factors with more than three levels.

  4. 4.

    In fact, one can actually compute four two-factor interactions: between linear A and linear B, between linear A and quadratic B, between quadratic A and linear B, and between quadratic A and quadratic B.

  5. 5.

    JMP gives an error message if we try to include the quadratic terms in the “model” since the independent variables used are categorical/nominal (that is, the levels were assigned as low, medium, and high). It automatically removes the terms from the analysis.

Author information

Authors and Affiliations

Authors

1 Electronic Supplementary Material

Appendix

Appendix

Example 12.6 Selling Toys Example using SPSS

From the perspective of SPSS , the toy-store problem is a two-factor cross-classification with replication. The data were entered as shown in Table 12.13 and SPSS was told that the first and second columns represent the levels of the row (A) and column (B) factors , respectively, and the third column represents the dependent variable . Table 12.14 shows the SPSS output.

Table 12.13 SPSS input format for toy study
Table 12.14 SPSS ANOVA table for toy-store example

The breakdown of the main-effect sum of squares into linear and quadratic components in an augmented ANOVA table is not provided, but would have to be independently and separately generated. For this, we can use a syntax to specify the coefficients for factors A and B, as shown in Fig. 12.10, where L1 and L2 are the linear and quadratic components, respectively. This will generate the results shown in Tables 12.15 and 12.16.

Fig. 12.10
figure 10

Steps for setting up the contrast coefficients in SPSS

Table 12.15 Decomposition of sum of squares for factor A in SPSS
Table 12.16 Decomposition of sum of squares for factor B in SPSS

Example 12.7 Selling Toys Example using R

In this example, we will use the fac.design() introduced in previous chapters. We will use −1, 0, and 1 to identify the levels, but we could have used “low,” “medium,” and “high” or any other classification.

> design <- fac.design(nlevels=3, nfactors=2, factor.names=list+(A=c(-1,0,1), B=c(-1,0,1)), replications=2, randomize=FALSE) creating full factorial with 9 runs ..

Next, we create a vector with the responses and add it to the design table:

> y <- c(47, 57, 70, 34, 80, 105, 60, 81, 88, 45, 43, 86, 46, 92, 99, 80, +67, 92) > design <- add.response(design=design, response=y) > design

 

run.no

run.no.std.rp

A

B

Blocks

y

1

1

1.1

-1

-1

.1

47

2

2

2.1

0

-1

.1

57

3

3

3.1

1

-1

.1

70

4

4

4.1

-1

0

.1

34

5

5

5.1

0

0

.1

80

6

6

6.1

1

0

.1

105

7

7

7.1

-1

1

.1

60

8

8

8.1

0

1

.1

81

9

9

9.1

1

1

.1

88

10

10

1.2

-1

-1

.2

45

11

11

2.2

0

-1

.2

43

12

12

3.2

1

-1

.2

86

13

13

4.2

-1

0

.2

46

14

14

5.2

0

0

.2

92

15

15

6.2

1

0

.2

99

16

16

7.2

-1

1

.2

80

17

17

8.2

0

1

.2

67

18

18

9.2

1

1

.2

92

class=design, type= full factorial NOTE: columns run.no and run.no.std.rp are annotation, not part of the data frame

To obtain the ANOVA table:

> design.aov <- aov(y~A*B, data=design) > summary(design.aov)

 

Df

Sum Sq

Mean Sq

F value

Pr(>F)

 

A

2

4336

2168.0

28.034

0.000136

***

B

2

1456

728.0

9.414

0.006222

**

A:B

4

1472

368.0

4.759

0.024406

*

Residuals

9

696

77.3

   

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

As in the procedure described in Chap. 5, we have to set up a matrix with the contrast coefficients that will be used to decompose the sum of squares.

> matrix <- matrix(c(-1,0,1,0.5,-1,0.5), nrow=3, ncol=2, +byrow=F) > matrix

 

[,1]

[,2]

[1,]

-1

0.5

[2,]

0

-1.0

[3,]

1

0.5

> contrasts(design$A) <- matrix > contrasts(design$B) <- matrix

To determine if the coefficients have been correctly assigned, we use

> design.aov$contrasts $A

[,1]

[,2]

-1

0.5

0

-1.0

1

0.5

$B

[,1]

[,2]

-1

0.5

0

-1.0

1

0.5

We can run ANOVA again without the interaction term, assuming we are only interested in the linear and quadratic components. Otherwise, R will use the coefficients to break down SSQinteraction, as shown below. The following command decomposes the sum of squares and is valid for both situations – with or without the interaction term.

> summary.aov (design.aov2, split=list(A=list(1, 2, 3), +B=list(1,2,3)))

 

Df

Sum Sq

Mean Sq

F value

Pr(>F)

 

A

2

4336

2168

28.034

0.000136

***

A: C1

1

4332

4332

56.017

3.75e-05

***

A: C2

1

4

4

0.052

0.825172

 

A: C3

1

     

B

2

1456

728

9.414

0.006222

**

B: C1

1

1200

1200

15.517

0.003410

**

B: C2

1

256

256

3.310

0.102195

 

B: C3

1

     

A:B

4

1472

368

4.759

0.024406

*

A:B: C1.C1

1

72

72

0.931

0.359804

 

A:B: C2.C1

1

24

24

0.310

0.591051

 

A:B: C3.C1

1

     

A:B: C1.C2

1

864

864

11.172

0.008626

**

A:B: C2.C2

1

512

512

6.621

0.030036

*

A:B: C3.C2

1

     

A:B: C1.C3

1

     

A:B: C2.C3

1

     

A:B: C3.C3

1

     

Residuals

9

696

77

   

--- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Berger, P.D., Maurer, R.E., Celli, G.B. (2018). Designs with Factors at Three Levels. In: Experimental Design. Springer, Cham. https://doi.org/10.1007/978-3-319-64583-4_12

Download citation

Publish with us

Policies and ethics