Examples / 02

Response surface with four factors and three responses: an API synthesis

A screening has shown four factors of a coupling reaction to be active. The question is no longer whether they act but where they should be set — for three responses at once that do not agree: more temperature and more catalyst bring yield, but also by-product and palladium in the product.

Design
Central composite, rotatable (α = 2)
Runs
16 + 8 + 6 = 30
Factors
4, no constraints
Responses
Yield, by-product, residual palladium

The measurements are simulated. They come from three models we set ourselves, plus random scatter — which makes it possible to check at the end whether the analysis finds what is really in there. Every table and chart was computed and drawn by DoEStat.

Step 1 / The question

Four factors, three goals, one compromise

The subject is the last step of an API synthesis, a palladium-catalysed coupling. The four factors are temperature, reaction time, catalyst loading and the equivalents of base. Three quantities are measured on every batch:

  • Yield in per cent — to be maximised; below 80% the batch is unusable, from 90% the goal is fully met.
  • By-product in per cent — to be minimised; at most 2.0%, ideally 1.0% or less.
  • Residual palladium in ppm — to be minimised; at most 30 ppm, ideally 15 ppm or less. This response counts a third as much in the trade-off as the other two, because a downstream purification can still lower it.
FactorUnit−α−10+1+α
Temperature°C60708090100
Reaction timeh1.02.03.04.05.0
Catalystmol-%0.501.001.502.002.50
Baseeq1.502.002.503.003.50

There are no constraints: every combination of the levels can be run, including the outermost. That is the precondition for a standard design.

Step 2 / Design

A central composite design, and what it promises before the first run

To find an optimum in the interior the model must be able to describe curvature — that is, contain quadratic terms, and for that every factor needs more than two levels. The central composite design provides this at little cost: 16 cube points (all combinations of −1 and +1), 8 axial points (one factor at ±α, the others at the centre) and 6 replicates at the centre. With α = 2 the design is rotatable: the prediction is equally precise at equal distance from the centre in every direction. The axial points lie outside the cube; the ±1 levels are therefore placed so that ±α is still within the safe range.

What the design can do can be checked before a single batch is run:

Term groupPower at 1 σPower at 2 σVIF
Main effects99.5100.01.00
Two-factor interactions96.2100.01.00
Quadratic terms99.8100.01.05

The variance inflation (VIF) of 1.00 to 1.05 says that the 14 model terms practically do not interfere with one another. An effect the size of one standard deviation is detected with a probability of 96 to over 99%, depending on the term group. The design carries the full quadratic model with 15 degrees of freedom to spare, five of them pure error from the centre runs.

Design and measurements

The runs are listed in the random order in which they were carried out.

RunPointTemperature [°C]Reaction time [h]Catalyst [mol-%]Base [eq]Yield [%]By-product [%]Residual palladium [ppm]
1cube704.01.002.0077.11.3816.0
2cube704.02.002.0081.11.6934.0
3cube702.01.002.0069.41.1314.0
4centre803.01.502.5086.81.7423.7
5cube904.02.002.0086.93.2240.0
6axial803.01.501.5078.31.9429.6
7axial803.02.502.5082.21.5250.1
8axial603.01.502.5069.71.3621.8
9centre803.01.502.5084.61.4622.9
10cube702.02.002.0073.41.4136.0
11axial801.01.502.5075.40.9323.4
12cube904.01.003.0079.12.5116.3
13axial803.01.503.5085.31.1119.0
14centre803.01.502.5086.41.6720.3
15cube902.02.002.0083.42.0339.4
16cube702.01.003.0071.00.8713.4
17axial805.01.502.5086.32.1724.1
18cube902.01.003.0077.81.5019.6
19cube904.02.003.0087.72.6831.1
20centre803.01.502.5085.91.5820.6
21cube902.02.003.0087.61.5333.1
22cube704.01.003.0078.50.9513.4
23axial803.00.502.5072.51.3814.4
24cube702.02.003.0075.61.1232.3
25centre803.01.502.5086.91.6224.3
26cube902.01.002.0074.81.8321.0
27cube904.01.002.0078.93.0420.9
28centre803.01.502.5087.31.6323.8
29axial1003.01.502.5082.03.5426.8
30cube704.02.003.0083.71.1931.1

Step 3 / Choosing the model

Which order, which terms

First the question of model order. For each response DoEStat compares the linear model, the model with interactions and the quadratic one: does the next order add significantly (sequential p), and does the model then agree with the replicates (lack of fit)? For the yield:

Model orderSequential pLack of fit pAdj. R²Pred. R²Suggested
Linear< 0.00010.00190.57030.5237
+ interactions0.78490.00120.51460.4586
+ quadratic terms< 0.00010.46920.97010.9312✓

The linear model explains a good half of the variation and shows clear lack of fit. The interactions alone do not help, but the quadratic terms do a great deal: only with them does the lack of fit disappear. For by-product and residual palladium the decision comes out the same way.

Model order for by-product and residual palladium
Model orderSequential pLack of fit pAdj. R²Pred. R²Suggested
Linear< 0.00010.00420.78000.7079
+ interactions0.10150.00650.82590.8171
+ quadratic terms< 0.00010.90950.98860.9805✓
Model orderSequential pLack of fit pAdj. R²Pred. R²Suggested
Linear< 0.00010.09530.89350.8685
+ interactions0.78520.06760.87970.8643
+ quadratic terms< 0.00010.82120.97440.9516✓

The full quadratic model has 14 terms. Not every response needs all of them. DoEStat removes backwards whatever is not significant (p-value, α = 0.05) while keeping the hierarchy: a main effect stays as long as a square or an interaction contains it. Every response gets its own model:

ResponseTerms in the modelR²Adj. R²Pred. R²Residual sLack of fit pAdequate precision
Yield [%]100.98130.97150.94370.9870.517732.8
By-product [%]70.98860.98500.97710.08270.729862.5
Residual palladium [ppm]40.97060.96590.96011.650.623355.6

The yield keeps ten terms, the by-product seven, the residual palladium four. For all three the predicted R² is above 0.94 and close to the adjusted one — the models do not just describe the 30 batches, they also predict new ones. The adequate precision, the ratio of signal to noise, is far above the guide value of 4.

Step 4 / Checking the models

Analysis of variance, coefficients, residuals

The analysis of variance of the yield splits the variation: what the model explains, term by term, and what remains — divided into lack of fit and pure error from the six centre runs.

SourceSum of squaresdfMean squareFp
Model972.41097.2499.89< 0.0001
Temperature210.01210.0215.77< 0.0001
Reaction time159.11159.1163.47< 0.0001
Catalyst217.21217.2223.12< 0.0001
Base37.50137.5038.52< 0.0001
Temperature × Reaction time30.25130.2531.07< 0.0001
Temperature × Catalyst18.49118.4918.990.0003
Temperature²183.91183.9188.95< 0.0001
Reaction time²49.22149.2250.56< 0.0001
Catalyst²134.51134.5138.19< 0.0001
Base²33.31133.3134.22< 0.0001
Residual18.50190.9735
Lack of fit13.83140.98771.060.5177
Pure error4.66850.9337
Total990.929

The lack of fit is not significant (p = 0.52): what the model does not explain is no larger than the scatter between identical batches. The coefficients in coded units:

TermCoefficient (coded)Std. errortp95% CI lower95% CI upper
Intercept86.320.4028214.29< 0.000185.4787.16
Temperature2.9580.201414.69< 0.00012.5373.380
Reaction time2.5750.201412.79< 0.00012.1532.997
Catalyst3.0080.201414.94< 0.00012.5873.430
Base1.2500.20146.21< 0.00010.82851.672
Temperature × Reaction time−1.3750.2467−5.57< 0.0001−1.891−0.8587
Temperature × Catalyst1.0750.24674.360.00030.55871.591
Temperature²−2.5900.1884−13.75< 0.0001−2.984−2.195
Reaction time²−1.3400.1884−7.11< 0.0001−1.734−0.9453
Catalyst²−2.2150.1884−11.76< 0.0001−2.609−1.820
Base²−1.1020.1884−5.85< 0.0001−1.496−0.7078

All four factors raise the yield, and all four have a negative square: too much of a good thing costs again. The interaction temperature × reaction time is negative — long and hot does harm — and temperature × catalyst is positive.

Analysis of variance and coefficients for by-product and residual palladium
SourceSum of squaresdfMean squareFp
Model13.0571.864272.50< 0.0001
Temperature6.99816.9981022.97< 0.0001
Reaction time2.48312.483362.98< 0.0001
Catalyst0.156810.156822.92< 0.0001
Base1.05811.058154.71< 0.0001
Temperature × Reaction time0.940910.9409137.53< 0.0001
Temperature²1.31111.311191.63< 0.0001
Catalyst²0.0354710.035475.180.0329
Residual0.1505220.006841
Lack of fit0.1064170.0062570.710.7298
Pure error0.0441350.008827
Total13.2029
TermCoefficient (coded)Std. errortp95% CI lower95% CI upper
Intercept1.5810.0238866.21< 0.00011.5311.630
Temperature0.54000.0168831.98< 0.00010.50500.5750
Reaction time0.32170.0168819.05< 0.00010.28670.3567
Catalyst0.080830.016884.79< 0.00010.045820.1158
Base−0.21000.01688−12.44< 0.0001−0.2450−0.1750
Temperature × Reaction time0.24250.0206811.73< 0.00010.19960.2854
Temperature²0.21470.0155113.84< 0.00010.18250.2469
Catalyst²−0.035310.01551−2.280.0329−0.06748−0.003150
SourceSum of squaresdfMean squareFp
Model22334558.3206.08< 0.0001
Temperature70.73170.7326.11< 0.0001
Catalyst190511905703.04< 0.0001
Base113.51113.541.91< 0.0001
Catalyst²144.41144.453.29< 0.0001
Residual67.73252.709
Lack of fit52.81202.6400.880.6233
Pure error14.9252.984
Total230129
TermCoefficient (coded)Std. errortp95% CI lower95% CI upper
Intercept23.420.388060.37< 0.000122.6224.22
Temperature1.7170.33605.11< 0.00011.0252.409
Catalyst8.9080.336026.51< 0.00018.2169.600
Base−2.1750.3360−6.47< 0.0001−2.867−1.483
Catalyst²2.2390.30677.30< 0.00011.6072.871
Residuals of the yield against predicted values: the points scatter evenly around the zero line.
Residuals against predictionNo structure: the scatter is the same across the whole range of yield.
Normal quantile plot of the standardised residuals of the yield: the points follow the straight line.
Normality of the residualsThe points follow the line — no transformation of the yield is needed.

Step 5 / Surfaces

What the models show

A model with four factors cannot be drawn as one picture. One cuts: two factors on the axes, the other two held at a fixed value — here at that of the optimal setting found later, marked as the point with the blue rim. The grey rings are the runs of the design.

Contour plot of the yield over temperature and catalyst: closed contour lines around a maximum of just over 88 per cent at about 86 degrees and 1.9 mol per cent; the marked optimal setting lies to the lower left of it at 76 degrees and 1.5 mol per cent.
Yield: temperature × catalystThe yield alone would peak further up and to the right. The marked compromise lies a good two percentage points below it.
Three-dimensional response surface of the yield over temperature and catalyst: a hill that falls away on all sides.
The same surface in 3DA hill: the negative squares of both factors bound it on all sides.
Contour plot of the by-product over temperature and reaction time: the values rise strongly from the lower left to the upper right, the lines are curved.
By-product: temperature × reaction timeHot and long drives the by-product — exactly the direction in which the yield at first still rises.
Contour plot of the residual palladium over catalyst and base: the values rise strongly with the catalyst and fall slightly with the base.
Residual palladium: catalyst × baseAlmost only the catalyst determines how much palladium stays in the product; more base lowers it a little.
Prediction profile of the yield: four curves side by side show the predicted yield over temperature, reaction time, catalyst and base, with a confidence band; every curve is an arc that opens downwards, and the current setting is marked at 86.0 per cent.
Prediction profile of the yieldFrom the left: temperature, reaction time, catalyst, base, each in coded units (−1 to +1). For each factor a cut through the surface at the optimal setting, with confidence band. In DoEStat the settings can be moved; all curves follow.

Step 6 / Optimisation

Three goals in one number: desirability

Three surfaces pointing in different directions cannot be overlaid by eye. Desirability turns each response into a number between 0 (specification missed) and 1 (goal fully met) and combines the three into an overall desirability D, weighted by importance. If a single response fails, D is zero — no good value can make up for a bad one. DoEStat searches for the setting with the largest D inside the cube; the axial points have served the model, production is to run in the well-supported core.

FactorSettingUnitcoded
Temperature76.0°C−0.40
Reaction time3.46h0.46
Catalyst1.500mol-%0.00
Base3.000eq1.00
ResponseGoalPrediction95% confidence interval95% prediction intervalDesirability dTrue value
Yield [%]maximise (80.0 → 90.0)86.0185.20 … 86.8283.79 … 88.230.60185.63
By-product [%]minimise (2.00 → 1.00)1.2911.228 … 1.3541.109 … 1.4740.7091.299
Residual palladium [ppm]minimise (30.0 → 15.0)20.5519.46 … 21.6516.99 … 24.120.63021.39

The overall desirability is 0.65. The compromise is easy to read: at 76 °C the temperature stays well below the yield maximum, because the by-product would otherwise rise; the catalyst sits at the centre, because more of it carries palladium into the product; the base sits at the upper edge, because it helps all three goals. A second, almost equally good setting (D = 0.64) lies at 74 °C and four hours — colder and longer. DoEStat reports such alternatives; which one to take is for the plant to decide.

Ramps plot: at the top four sliders for the factors with the optimal setting, below a ramp for each of the three responses with the predicted value as a point, at the bottom a bar for the overall desirability of 0.649.
RampsEach response on its ramp: where the point sits is how far the goal is met.
Overlay plot over temperature and catalyst: a yellow feasible region, bounded on the right by the line by-product equals 2 and at the top by residual palladium equals 30; a crosshair marks the optimal setting in the interior.
Overlay: the feasible windowYellow is where all three specifications are met. The setting lies inside the window, clear of its borders.

All responses in one picture

The overlay plot shows only the limits. The overlaid view adds the contour lines of every response in its own colour: one sees not only where the window lies but also how each response behaves inside it. The heavy lines are the limits — solid for a lower limit, dashed for an upper one — the shaded region is the sweet spot, and the dot the optimum. The pictures reach beyond the cube out to the axial points, so that the limits can be seen in full.

Overlaid contour plot over temperature and catalyst: blue contour lines of the yield, red ones of the by-product, green ones of the residual palladium. A shaded region is bounded on the left and at the bottom by the heavy blue line yield equals 80, on the right by the dashed red line by-product equals 2 and at the top by the dashed green line residual palladium equals 30; the optimum lies as a dot in its middle.
Temperature × catalystThree responses, three limits, one window: at the bottom and left yield is missing, on the right there is too much by-product, at the top too much palladium.
Overlaid contour plot over temperature and reaction time: the shaded region lies between the heavy blue line yield equals 80 at the lower left and the dashed red line by-product equals 2 at the upper right; the green lines of the residual palladium run vertically.
Temperature × reaction timeHot and long exceeds the by-product limit; cold and short does not reach the yield. The palladium does not depend on time at all — its lines are vertical.
Overlaid contour plot over catalyst and base: the shaded region is bounded on the left and at the bottom by the heavy blue line yield equals 80 and on the right by the dashed green line residual palladium equals 30; the optimum lies at 1.5 mol per cent catalyst and 3 equivalents of base.
Catalyst × baseMore catalyst runs into the palladium limit, less into that of the yield. More base pushes both limits apart — which is why it sits at the upper edge.

All three cuts pass through the optimum, and in all three it lies clear of the limits. That is the second thing the pictures tell: not only the best setting, but how much latitude it has in every direction.

Step 7 / Confirmation

Three batches at the recommended setting

A prediction is a claim until it has been run. Three confirmation batches at the optimal setting, against the 95% prediction interval for a single batch:

ResponsePrediction95% prediction intervalConfirmation 1Confirmation 2Confirmation 3Joint test p
Yield [%]86.0183.79 … 88.2385.285.686.80.7347
By-product [%]1.2911.109 … 1.4741.191.231.310.6122
Residual palladium [ppm]20.5516.99 … 24.1220.922.421.60.6754

Result: all nine measurements lie within the prediction interval, and no joint test responds. The setting delivers about 86% yield at 1.3% by-product and a little over 20 ppm residual palladium.

Cross-check

What is really in the data

The table sets the true coefficients from which the measurements were simulated beside the estimated ones. A true value of 0 means: in reality this term does not exist.

ResponseTermTrueEstimated95% CI
YieldIntercept86.086.385.5 … 87.2
YieldTemperature3.202.962.54 … 3.38
YieldReaction time2.402.572.15 … 3.00
YieldCatalyst2.903.012.59 … 3.43
YieldBase1.101.250.828 … 1.67
YieldTemperature × Reaction time−1.40−1.38−1.89 … −0.859
YieldTemperature × Catalyst1.001.070.559 … 1.59
YieldTemperature²−2.60−2.59−2.98 … −2.20
YieldReaction time²−1.50−1.34−1.73 … −0.945
YieldCatalyst²−1.90−2.21−2.61 … −1.82
YieldBase²−0.800−1.10−1.50 … −0.708
By-productIntercept1.601.581.53 … 1.63
By-productTemperature0.5500.5400.505 … 0.575
By-productReaction time0.3000.3220.287 … 0.357
By-productCatalyst0.1000.08080.0458 … 0.116
By-productBase−0.200−0.210−0.245 … −0.175
By-productTemperature × Reaction time0.2500.2420.200 … 0.285
By-productTemperature²0.1800.2150.183 … 0.247
By-productCatalyst²0−0.0353−0.0675 … −0.00315
Residual palladiumIntercept24.023.422.6 … 24.2
Residual palladiumTemperature1.501.721.02 … 2.41
Residual palladiumCatalyst9.008.918.22 … 9.60
Residual palladiumBase−2.00−2.17−2.87 … −1.48
Residual palladiumCatalyst²2.002.241.61 … 2.87

For the yield the analysis found exactly the ten terms that exist. Two deviations are instructive. For the by-product a small catalyst square stayed in the model (p = 0.033) that does not exist in truth — with α = 0.05 and three responses with 14 candidates each, one such false hit is to be expected, and at −0.035 it is of no practical consequence. For the residual palladium, conversely, the interaction catalyst × base (truly −1.2 ppm) was lost in the noise. Neither changes anything at the optimal setting: the true values there are in the last column of the optimisation table and all lie within the prediction interval.

Project files

Run it yourself

The example ships with DoEStat: Help ▸ Open sample project ▸ Response surface (RSM) ▸ “Response surface, four factors, three responses: API synthesis”, once with the data only and once with the finished analysis. The same files can be downloaded here.

Back: screening with ten factors Next: mixture with constraints

Try DoEStat for free

30 days, the full feature set, no payment details. We send the download link by e-mail, usually on the next business day.

Request the trial