Home / DOE / Charts / Surface Plot
Surface Plot¶
A surface plot draws the fitted response as a three dimensional surface over two factors, with every other factor held at a set point.
QXL DOE New > Charts > Analysis > Surface Plot
The same dialog and the same mathematics produce the Contour Plot, which shows the same surface from above as lines of equal response. On the QXL DOE New tab the two are separate ribbon commands.
When to use it¶
A surface shows curvature and the location of a maximum, minimum or saddle in a way a table of coefficients does not. It needs a model that can curve, so it is most informative after a design with centre points or axial points, where quadratic terms can be estimated.
Where the numbers come from¶
This chart is built from a regression sheet only. Design sheets are not offered, because the chart plots a value that only a fitted model can produce.
A chart built from a regression sheet does not re-fit the model. It reads the coefficients already on that sheet and evaluates the prediction equation with them.
Two things follow. The chart always agrees with the sheet it came from, so if you edit a coefficient the next chart changes with it. And a chart is only as current as its regression sheet: change the design and the old charts do not update, because nothing re-runs the regression for them.
A term that is not in the regression table, or that is switched off for the output level being charted, contributes exactly zero to the prediction. It is not an error and there is no warning: the chart is simply drawn from the reduced model. So a chart reflects which terms are active at the moment it is created, and two charts of the same output can differ because the active terms changed between them.
The dialog¶
The left side of the dialog is a box headed Outputs holding a tree with three levels: the worksheet, then each output on it, then each level of that output. Tick the levels you want a chart for. The dialog opens with every level on the active sheet already ticked.
The two upper levels are three-state. Ticking a worksheet or an output ticks everything under it, and clearing it clears everything under it. When only some of the children are ticked, the parent shows a partial state rather than a tick, so the tree tells you at a glance whether a selection is complete.
One worksheet at a time. Ticking anything on a second worksheet silently clears every tick on the one you had selected, and the options on the right rebuild for the new sheet. There is no warning and no way to draw charts from two source sheets in one Create.
If you press Create with nothing ticked, the dialog tells you At least one chart must be selected. and stays open.
Chart layout¶
The box headed Chart layout decides how many charts one Create produces.
All factor pairs (grid) lays the ticked factors out as a square grid on one worksheet, with the factor names down the diagonal. Every pair appears twice, once with each factor on the horizontal axis, because the two orders are different charts. So four ticked factors give twelve charts on one sheet, not six. Use it to scan a model.
One specific pair draws a single chart from the two factors you name below, and gives it the whole sheet. Use it once you know which pair you care about.
A grid cell is only drawn when its factors suit the chart. On a surface grid the horizontal factor must be quantitative; on a contour grid both factors must be. A cell that fails the rule is left as NA rather than as a chart, so a model with categorical factors gives a grid with gaps in it.
The box headed Factors to plot carries a checkbox per factor and feeds the grid: the pairs are made from the factors ticked here. It has no effect when you have chosen one specific pair, because the pair is then taken from the two axis pickers instead.
In grid mode you get one worksheet per ticked output level, each holding that level's full grid of pairs. Ticking three levels therefore produces three grid sheets, not one sheet with everything on it.
The axes¶
With one specific pair chosen, Horizontal axis (X) and Series axis (Y) each take a factor and a From and to range. The range decides how much of the factor space the surface covers, and it does not have to match the range the factor was run over: a narrower range zooms in, a wider one extrapolates.
Set points¶
A chart can only vary the factors on its axes. Every other factor in the model has to be held at some value while the chart is drawn, and the box headed Set points (factors held constant) is where you choose those values.
The box is not always on screen. It belongs to a prediction, so:
- With a design sheet as the source it disappears entirely. A design-source chart averages the runs at each setting instead of predicting, so nothing is held constant, and the extrapolation prompt cannot appear either.
- On the Surface, Contour, Trellis and Cube dialogs it also disappears when no factor is being held, which happens when every factor in the model is on an axis.
Which factors get a row differs by dialog. On Surface, Contour, Trellis and Cube a factor's row is hidden while that factor is on an axis, except in grid mode, where every factor keeps a row because each one is held constant in the cells where it is not an axis. On the Interaction, Main Effects and Thumbnail dialog every factor keeps a row, and the rows for the plotted factors have no effect.
The set points are part of the prediction, not decoration. Changing one moves the whole surface, because the fitted model includes that factor and any interactions it appears in. Two charts of the same pair of factors at different set points are two different slices of the same model, and they can look nothing alike when the held factor interacts with an axis factor.
For a quantitative factor the set point is a value. For a categorical factor it is one of its levels.
A set point outside the range the factor took in the data makes the chart an extrapolation, and the software asks before drawing it. Keeping set points inside the observed range keeps the chart inside the region the experiment actually covered.
Before it draws¶
If anything you typed reaches outside the range the factor actually took in the data, the software asks before drawing. A set point is one source of that. On the dialogs that carry axis range boxes, which are Surface Plot, Contour Plot and Trellis, a From or to value counts too, as does a trellis slice range, so widening an axis past the experimental range raises the prompt on its own with every set point left alone. The prompt lists each offending entry with the factor's experimental range beside it, warns that the chart will extrapolate beyond the data, and asks whether to create it anyway. Answering no returns you to the dialog with your options intact.
This is a warning, not a refusal. A prediction outside the range of the data is an extrapolation of the fitted model, and the model was never tested there.
While charts are being written, a status line reports what is happening and a progress bar appears only when more than one chart is being drawn, since a bar for a single chart would sit at 100 percent from the moment it appeared.
Cancel stops the run cleanly between charts, not part way through one. A chart that has already been written stays; the sheet that was mid-write is deleted rather than left half finished. So cancelling never leaves a partial chart behind, but it can leave fewer sheets than you asked for.
What you get¶
A worksheet named Surface Plot - output level name, placed immediately to the right of the regression sheet.
In grid mode you get one such sheet per ticked output level, holding the all pairs grid for that level. In single mode you get one chart per ticked level.
The sheet name does not tell you which mode produced it, or whether it is a trellis. Single, grid and trellis all use the same Surface Plot - output level name form. See DOE Charts for the naming rule across the whole family.
How it is calculated¶
The surface is a grid of predictions. Each quantitative axis carries 41 evenly spaced values, from the From value to the to value inclusive, which is 40 steps between them. The model is evaluated at every intersection of the two axes, so a chart with two quantitative axes is 1681 predictions:
A prediction is the sum, over every term in the model, of that term's coded value times its coefficient:
where \(c_j\) is the coded value of term \(j\) at the settings you asked about and \(b_j\) is its coefficient from the regression table. The constant term has \(c_j = 1\), so its coefficient enters as itself.
A term that is absent from the regression table, or switched off for the level being predicted, contributes \(b_j = 0\).
For a binary or nominal output the height is a predicted probability instead. Full details: Prediction Equation.
A categorical factor can carry an axis here, and it is put on the series axis. The rule is that at least one of the two axes must be quantitative: if you pick a categorical factor for Horizontal axis (X) and a quantitative one for Series axis (Y), the two are swapped so the quantitative factor runs along the horizontal axis, and the categorical factor is drawn as one ribbon per level. Picking categorical factors for both axes is refused with At least one axis factor must be continuous.
A categorical series axis has levels rather than a range, so it has no From and to boxes.
A factor is either Quantitative or Categorical, and the choice changes what the software can do with it.
A Quantitative factor takes numeric values on a scale, so the model can interpolate between the settings you ran and predict at a value you did not run. It is coded to a common scale before the regression, and it can carry an axis on a surface or contour chart.
A Categorical factor takes named levels with no scale between them. It is never coded to a numeric range; instead each non-reference level gets its own coefficient. There is nothing between two levels to predict at, so a chart that needs to evaluate the model between settings either refuses a categorical factor on that axis or draws it as separate levels rather than as a line. Which of the two depends on the chart, and each chart page says.
The two factor axes run exactly from the From value to the to value you typed, with no rounding. It is the response axis that is put on round tick values.
See Also¶
- Contour Plot, the same surface seen from above
- Trellis, the same surface repeated across slices of another factor
- Cube Plot, the corners only, with numbers on them
- Chart Source
- Prediction Equation