Hello,
I'm trying to build a design using the DOE custom design platform. I have three categorical factors (G, L, and Z) to consider, with one nested within another. Ultimately, the model I want to run is Y = G + L[Z] + Z + e. However, my primary goal is to ensure that the number of replications of G is balanced within Z, and that the number of runs is balanced across my L factor.
By using the "Disallowed Combinations" option, I managed to get something close to my desired outcome. For example, this script produces results that are fairly close to what I want:
DOE(
Custom Design,
{Add Response( Maximize, "Y", ., ., . ),
Add Factor(
Categorical,
{"L1", "L2", "L3", "L4", "L5", "L6", "L7", "L8", "L9", "L10"},
"L",
0
), Add Factor(
Categorical,
{"V1", "V2", "V3", "V4", "V5", "V6",
"V7", "V8", "V9", "V10", "V11", "V12",
"V13", "V14", "V15", "V16", "V17", "V18",
"V19", "V20", "V21", "V22", "V23", "V24",
"V25", "V26", "V27", "V28", "V29", "V30",
"V31", "V32"},
"G",
0
), Add Factor( Categorical, {"Z1", "Z2"}, "Z", 0 ),
Set Random Seed( 1289561612 ), Number of Starts( 360 ), Add Term( {1, 0} ),
Add Term( {1, 1} ), Add Term( {2, 1} ), Add Potential Term( {3, 1} ),
Set Sample Size( 360), Disallowed Combinations(
Z == "Z1" & (L == "L6" | L == "L7" |
L == "L8" | L == "L9" | L == "L10") |
Z == "Z2" & (L == "L1" | L == "L2" |
L == "L3" | L == "L4" | L == "L5")
), Simulate Responses( 0 ), Save X Matrix( 0 ), Make Design}
);
Nevertheless, this is far from perfect because the number of levels for L, Z, and G can vary significantly depanding on the designs I have to create and and I have many! This approach is not straightforward to automate through scripting.
Moreover, the number of replications per Z level for my G factor is not perfectly balanced, as shown in the following summary of my results table:

Any thought is welcome
I'm using JMP16