Full Factorial Designs
R2026bFull factorial designs measure response variables using every possible treatment (combination of the factor levels). A full factorial design for n factors with N1, ..., Nn levels requires N1 × ... × Nn experimental runs—one for each treatment. While advantageous for separating individual effects, full factorial designs can make large demands on data collection. To learn about designs that involve fewer experimental runs, see Fractional Factorial Designs.
Statistics and Machine Learning Toolbox™ offers several ways to work with full factorial designs:
Create a
fullFactorialDOEobject by using thefullFactorialDOEfunction. ThefullFactorialDOEfunction provides these advantages:The
fullFactorialDOEfunction allows you to specify the factor names, which factors are categorical, level values for each factor, and experiment model.In addition to returning the design runs, the
fullFactorialDOEfunction stores your specifications in thefullFactorialDOEobject properties.
After you create a
fullFactorialDOEobject, you canFit a linear regression model to the design run responses using the
fitlmfunction.Randomize the run order in the design using the
randomizeRunOrderfunction.Add replicates (duplicates of the original design runs) using the
addReplicatesfunction.
See the examples below and the
fullFactorialDOEreference page for more information.Use the DOE Explorer app to create a full factorial design table and fit a linear regression model to the design run responses. Perform factor analysis and generate plots and tables to assess the model fit.
Generate Multilevel Full Factorial Design
Suppose a machine shop has three machines labeled 1, 2, and 3 and four operators Op1, Op2, Op3, and Op4. If the same operator always uses the same machine, it is impossible to determine if a machine or an operator is the cause of variation in production. By allowing every operator to use every machine, effects are separated.
Generate a full factorial design by creating a fullFactorialDOE object.
dFF = fullFactorialDOE([1 2 3],["Op1" "Op2" "Op3" "Op4"], ... FactorNames=["Machine","Operator"], ... CategoricalFactors="all")
dFF =
fullFactorialDOE with properties:
Design: [12×2 table]
StandardRunOrder: [12×1 double]
ModelSpecification: "1 + Machine + Operator"
Levels: {[1 2 3] ["Op1" "Op2" "Op3" "Op4"]}
CategoricalFactors: [1 2]
IsRandomized: 0
NumReplicates: 0
Display the design table.
dFF.Design
ans = 12×2 table
Machine Operator
_______ ________
1 "Op1"
1 "Op2"
1 "Op3"
1 "Op4"
2 "Op1"
2 "Op2"
2 "Op3"
2 "Op4"
3 "Op1"
3 "Op2"
3 "Op3"
3 "Op4"
Each of the 3×4 = 12 rows of dFF represents one machine/operator combination.
Generate Two-Level Full Factorial Design
Many experiments can be conducted with two-level factors, using two-level designs. Suppose the machine shop in the previous example always keeps the same operator on the same machine, but wants to measure production effects that depend on the composition of the day and night shifts.
Generate a two-level full factorial design by creating a fullFactorialDOE object.
dFF = fullFactorialDOE(4,FactorNames=["Op1" "Op2" "Op3" "Op4"])
dFF =
fullFactorialDOE with properties:
Design: [16×4 table]
StandardRunOrder: [16×1 double]
ModelSpecification: "1 + Op1 + Op2 + Op3 + Op4"
Levels: {[-1 1] [-1 1] [-1 1] [-1 1]}
CategoricalFactors: []
IsRandomized: 0
NumReplicates: 0
Display the design table.
dFF.Design
ans = 16×4 table
Op1 Op2 Op3 Op4
___ ___ ___ ___
-1 -1 -1 -1
-1 -1 -1 1
-1 -1 1 -1
-1 -1 1 1
-1 1 -1 -1
-1 1 -1 1
-1 1 1 -1
-1 1 1 1
1 -1 -1 -1
1 -1 -1 1
1 -1 1 -1
1 -1 1 1
1 1 -1 -1
1 1 -1 1
1 1 1 -1
1 1 1 1
Each of the 2^4 = 16 rows of dFF represents one schedule of operators for the day (1) and night (–1) shifts.