Skip to content

Home / DOE / Charts / Trellis / Math Details

Math Details

This page gives the values a trellis draws and how each one is formed: where the panels come from, what slice each panel is held at, how the one shared response scale is chosen, and when a panel is left undrawn.

A trellis adds one piece of arithmetic and no more. Every panel is produced by the engine of the chart that panel is, the same call the single chart makes, with the panel variables fixed at that panel's slice values. The only new computation is the shared scale: the smallest and the largest value across all panels, rounded out once so every panel can be read against every other.

Notation

Term Description
\(X\), \(Y\) the two primary factors, on the horizontal axis and the series axis of every panel
\(P\) the first panel variable, whose slices become the columns
\(Q\) the second panel variable, when present, whose slices become the rows
\(m\), \(n\) the number of slices of \(P\) and of \(Q\); \(n = 1\) when there is no second panel variable
\(P_{\text{lo}}\), \(P_{\text{hi}}\) the From and to values of \(P\), used only when \(P\) is quantitative
\(p_i\) the \(i\)th slice value of \(P\), for \(i = 0, 1, \dots, m - 1\)
\(q_l\) the \(l\)th slice value of \(Q\), for \(l = 0, 1, \dots, n - 1\)
\(t_k\) the set point typed or picked for factor \(k\)
\(\mathbf{z}\), \(z_k\) the vector of factor settings handed to the panel's own engine, and its entry for factor \(k\)
\(w_{\min}\), \(w_{\max}\) the smallest and the largest value plotted anywhere in the whole trellis
\(\Delta\) the tick spacing of the shared scale
\(r\) the rounded range the shared scale is built from
\(w_{\text{low}}\), \(w_{\text{high}}\) the two ends of the shared scale

The slice values

A quantitative panel variable is sliced evenly across its own range, with the count taken from the Slices box rather than fixed:

\[ p_i = P_{\text{lo}} + i \cdot \frac{P_{\text{hi}} - P_{\text{lo}}}{m - 1}, \qquad i = 0, 1, \dots, m - 2, \qquad p_{m-1} = P_{\text{hi}} \]

As on the Surface Plot, the last slice is assigned rather than computed, so the top of the range is exactly the number you typed, and the others are the low value plus a whole multiple of the step, formed by multiplication rather than by adding the step repeatedly.

A single slice sits at the low end. With \(m = 1\) the expression above has no step to take, and the one slice is \(P_{\text{lo}}\), not the midpoint and not \(P_{\text{hi}}\).

A categorical panel variable is sliced by its ticked levels, one panel per level ticked, in the order the model holds them. The block is sliced the same way, one panel per block.

The second panel variable is sliced by the same two rules.

The grid of panels

The first panel variable gives the columns and the second, when present, gives the rows, so the trellis holds \(m \times n\) panels. With one panel variable \(n = 1\) and the panels are a single row.

Each band label carries the variable's name with that slice's value, written as name, equals sign and value. A quantitative slice is written with the product's nice-number formatting; a categorical slice is written as the level's own value; a block slice is written as the block number, which is the level index plus one.

The value inside one panel

The engine copies the set points, overwrites the entries belonging to the panel variables with that panel's own slice values, and hands the result to the engine of whichever chart type was chosen:

\[ z_k = \begin{cases} p_i, & k = P \\ q_l, & k = Q \\ t_k, & \text{otherwise} \end{cases} \]

The two primary factors' entries are left as they are, because the per-chart engine overwrites them itself at every point it plots, exactly as it does on a single chart.

From there the arithmetic is the panel's own chart, unchanged. A surface or contour panel is a grid of 41 positions per quantitative axis carrying predictions from the fitted coefficients, described on Surface Plot Math Details. An interaction panel is the points at the settings the runs visited plus a 100 point curve, described on Interaction Plots Math Details. Nothing about those computations changes because the chart is in a trellis.

A trellis reads a regression sheet only, so every panel value is a prediction.

The shared scale

This is the one thing a trellis computes that no single chart does, and it is the reason the panels can be compared. Every panel is built first. The engine then takes the smallest and the largest value plotted anywhere across all of them and rounds that one range out to nice numbers:

\[ e = \lfloor \log_{10} r \rfloor, \qquad \phi = \frac{r}{10^{e}}, \qquad \mathrm{nice}(r) = f \cdot 10^{e} \]

where \(e\) is the base ten exponent of \(r\), \(\phi\) is its leading fraction, and \(f\) is a nice fraction read from \(\phi\) by one of two tables. Rounding to the nearest takes \(f = 1, 2, 5, 10\) as \(\phi\) falls below \(1.5\), below \(3\), below \(7\), or higher; rounding up takes \(f = 1, 2, 5, 10\) as \(\phi\) is at most \(1\), at most \(2\), at most \(5\), or higher. The range is rounded up and the tick spacing to the nearest:

\[ r = \mathrm{nice}_{\text{up}}\left(w_{\max} - w_{\min}\right), \qquad \Delta = \mathrm{nice}_{\text{near}}\!\left(\frac{r}{10}\right) \]
\[ w_{\text{low}} = \Delta \left\lfloor \frac{w_{\min}}{\Delta} \right\rfloor, \qquad w_{\text{high}} = \Delta \left\lceil \frac{w_{\max}}{\Delta} \right\rceil \]

with the same three guards the other charts use: a range below \(10^{-5}\) is replaced by the largest power of ten not exceeding the larger of \(\lvert w_{\min} \rvert\) and \(\lvert w_{\max} \rvert\), and failing that by \(10^{-5}\); an end that rounding moved inside the data is pulled back to the data; and two ends that come out equal are each moved by \(r/2\).

The result is then pushed onto every panel. On a surface or contour trellis the two ends replace each panel's own computed height axis, so the scale a panel would have had on its own is discarded. The grid of values inside each panel is not touched, only the axis it is drawn against.

The panels are surveyed differently for the two kinds of chart. A surface or contour trellis reads every predicted value out of every panel's grid. An interaction trellis takes each panel's own smallest and largest plotted value as the panel engine reports them.

Only the two ends reach the chart. \(\Delta\) is used to place \(w_{\text{low}}\) and \(w_{\text{high}}\) and is then dropped. A surface or contour panel takes the same major-unit rule its single chart takes, the finished span divided by ten, so it carries ten intervals. On an interaction trellis the engine also computes the tick spacing and a decimal count for the shared axis and records both on the report, and nothing in the drawing code reads either of them: the writer takes the two ends alone.

A panel that was not drawn contributes nothing to the range and is not given the scale.

Panels that are not drawn

On a surface or contour trellis the primary pair is judged once, for the whole sheet. The rule is the one the single dialog and the surface grid use: the horizontal primary factor must be quantitative, and a contour needs the series one to be quantitative as well. The dialog applies the continuous-on-horizontal swap before the judgement, so a categorical and a quantitative factor pass. If the pair fails, every panel is left undrawn, because every panel is that same pair. There is no case where some panels of a surface trellis are drawn and others are not.

On an interaction trellis the judgement is per panel, made by the interaction engine itself. A panel is left undrawn when its primary pair is nested inside another factor, or when not one of its points carries a value.

What the heading block reports

Above the grid the engine writes the chart type, the name of the regression sheet the coefficients came from, the output level, a Panels: line naming which variable maps to the columns and, when there is a second one, which maps to the rows, and a Constant values: line listing each held factor as name and value, separated by semicolons. A quantitative value is written with the nice-number formatting; a categorical one as the level's own value; the block's entry is named block, spelled lower case as the product spells it, and its value is the block number, which is the level index plus one.

Neither panel variable is on the constants line, and neither primary factor is. All four are excluded by name. A panel variable is constant within a panel and different between panels, which is the opposite of what the line reports, and a primary factor is swept inside every panel. The Panels: line above is where the two panel variables are named.

Shared Math Details used here

This chart uses shared formulas defined once in Shared Math Details. See those pages for the exact definitions.

Shared concept Used here for Reference
Prediction equation every value in every panel Prediction Equation
Design coding turning a slice value or a set point into the coded value the prediction uses Design Coding

See Also

References

  1. Montgomery, D. C. (2013). Design and Analysis of Experiments, 8th edition. Wiley.
  2. Heckbert, P. S. (1990). Nice Numbers for Graph Labels. In A. S. Glassner (Ed.), Graphics Gems. Academic Press.