Home / DOE / Analyze / Nominal Logistic Regression / Nominal Logistic Regression How-To
Nominal Logistic Regression How-To¶
This walkthrough runs this engine on an output with three unordered outcomes and reads its report. You never select the engine. Run Regression chooses it because the output's declared type has three or more unordered outcomes, so the walkthrough is about setting that type and reading what comes back.
The data¶
The same three factors as every other DOE walkthrough, Temp in degrees C, Press in psi and Time in seconds. The response is Failure Mode, which is one of three words: Adhesive where the bond came away from the surface, Cohesive where the adhesive itself tore, and None where the bond held.
They are unordered. Adhesive is not more or less than Cohesive, which is exactly what separates this engine from an ordinal one, and it is why the report gives a whole set of coefficients per outcome rather than one set with thresholds.
Eight settings run four times each, thirty-two runs. Press Copy for Excel, then paste the table into a blank worksheet.
| Temp | Press | Time | Failure Mode |
|---|---|---|---|
| 180 | 40 | 10 | Adhesive |
| 220 | 40 | 10 | Adhesive |
| 180 | 60 | 10 | Adhesive |
| 220 | 60 | 10 | None |
| 180 | 40 | 20 | Cohesive |
| 220 | 40 | 20 | Cohesive |
| 180 | 60 | 20 | Cohesive |
| 220 | 60 | 20 | None |
| 180 | 40 | 10 | Adhesive |
| 220 | 40 | 10 | None |
| 180 | 60 | 10 | Adhesive |
| 220 | 60 | 10 | None |
| 180 | 40 | 20 | Cohesive |
| 220 | 40 | 20 | None |
| 180 | 60 | 20 | Cohesive |
| 220 | 60 | 20 | Cohesive |
| 180 | 40 | 10 | Cohesive |
| 220 | 40 | 10 | None |
| 180 | 60 | 10 | None |
| 220 | 60 | 10 | None |
| 180 | 40 | 20 | Adhesive |
| 220 | 40 | 20 | None |
| 180 | 60 | 20 | None |
| 220 | 60 | 20 | None |
| 180 | 40 | 10 | None |
| 220 | 40 | 10 | None |
| 180 | 60 | 10 | None |
| 220 | 60 | 10 | None |
| 180 | 40 | 20 | None |
| 220 | 40 | 20 | None |
| 180 | 60 | 20 | None |
| 220 | 60 | 20 | None |
Nineteen held, six failed adhesively and seven cohesively. As with the two-outcome engine, no outcome is confined to one setting of any factor: an outcome that never appears at one level has no finite coefficient, and the fit walks off rather than converging.
Steps¶
-
Put the data in Excel
Press Copy for Excel above the table, click cell A1 in a blank worksheet, and press Ctrl+V. The header row lands in row 1 and the 32 runs in rows 2 through 33.
-
Make a design sheet to hold it
QXL DOE New > Create Design > Special > Create Custom Design. Set the number of factors to 3 and the number of runs to 32, then set the number of outputs to 1.
-
Set the output's type to Nominal
Name the output Failure Mode and set Type: to Nominal. That is the whole of what picks this engine: Quantitative, Binary and Nominal are the three the list offers.
-
Name the baseline on the design sheet
The sheet the builder writes carries a cell labelled Ref. level under the output's name, with enter reference level (optional) --> beside it. Type None into the cell to the right of Ref. level.
Every coefficient on the report is measured against that level, so this choice decides what the coefficient columns mean and the numbers below assume it. The cell says optional and it is, but leave it blank and the engine picks: the fit is the same fit and the predicted probabilities are the same, but the coefficients describe something else.
-
Fill in the design sheet
Copy the four columns into the three factor columns and the one output column, and name the factors Temp, Press and Time. The response column is the one marked enter response data here -->.
-
Answer the two questions a custom design asks
Leave Type: at Quantitative for all three FACTORS, which is a different list from the output's. On the interaction page add nothing: this walkthrough fits the three main effects only.
-
Run the regression
QXL DOE New > Analyze Design > Run Regression. No dialog: the type on the sheet decides that this engine runs.
Confirm the engine that ran¶
The report names it, and it carries a convergence line. If that line is a warning rather than a statement that the fit converged, the coefficients are from the last iteration and nothing below them can be quoted.
If it names a different engine than you expected, the output's declared type is not what you thought, and that is the thing to fix rather than anything about the fit.
Two sets of coefficients, not one¶
With three outcomes and None as the baseline there are two sets, each describing one outcome against None:
| Outcome | Term | Coeff | SE | Z | P | Odds ratio |
|---|---|---|---|---|---|---|
| Adhesive | Const | -1.7582 | 0.7507 | -2.342 | 0.0192 | 0.1723 |
| Adhesive | Temp (A) | -1.2844 | 0.6464 | -1.987 | 0.0469 | 0.2768 |
| Adhesive | Press (B) | -0.6686 | 0.5793 | -1.154 | 0.2484 | 0.5124 |
| Adhesive | Time (C) | -0.7856 | 0.6571 | -1.195 | 0.2319 | 0.4559 |
| Cohesive | Const | -1.3716 | 0.6279 | -2.185 | 0.0289 | 0.2537 |
| Cohesive | Temp (A) | -0.8787 | 0.5252 | -1.673 | 0.0943 | 0.4153 |
| Cohesive | Press (B) | -0.3768 | 0.5115 | -0.737 | 0.4614 | 0.6861 |
| Cohesive | Time (C) | 0.9316 | 0.6154 | 1.514 | 0.1301 | 2.5386 |
None has no coefficients of its own, and that is not the same as being left out of the model. Every other outcome is measured against it, so it is the reference the whole table is built on.
Read a coefficient as an effect on the odds of that outcome rather than None. Adhesive's Temp coefficient is -1.2844, so raising Temp one coded unit, half its experimental range, multiplies the odds of an adhesive failure against a hold by 0.2768: it roughly quarters them.
The two sets do not have to agree, and here they disagree on Time. Adhesive's Time coefficient is -0.7856 and Cohesive's is +0.9316. Longer cure makes an adhesive failure less likely against a hold and a cohesive failure more likely. That is the finding a single two-outcome fit could not have produced: lump the two failure modes together into one Fail and the two effects partly cancel.
The fit statistics¶
| Statistic | Value |
|---|---|
| LogLikelihood | -22.8461 |
| RSquaredU | 0.2531 |
| AIC | 61.6923 |
| BIC | 73.4182 |
AIC and BIC charge for 8 parameters here, four terms on each of two sets, which is what makes them the statistics to use when comparing this against a smaller model.
Testing the model as a whole¶
| Value | |
|---|---|
| Log likelihood, constant only | -30.5873 |
| Log likelihood, full model | -22.8461 |
| G | 15.4823 |
| Degrees of freedom | 6 |
| P | 0.016820 |
Six degrees of freedom, not three. Every factor spends one degree of freedom per non-reference outcome, so three factors across two sets is six. At p = 0.0168 the three factors together explain something, and a small p value on G is the good outcome.
Goodness of fit: a large p value is the good result¶
| Test | Chi-square | DF | P |
|---|---|---|---|
| Pearson | 3.7305 | 8 | 0.8806 |
| Deviance | 4.4703 | 8 | 0.8124 |
Both large, so the fitted probabilities are consistent with the observed counts. The degrees of freedom are 8: eight distinct settings each carrying two free proportions, sixteen in all, less the 8 parameters fitted.
The predicted probability table¶
This is the block to read, and the one that does not depend on which outcome is the baseline. Pick a different reference level and every coefficient above changes; these probabilities do not move at all. The column always totals exactly 1, because the baseline's cell holds the reference-level formula directly rather than one minus the others.
| Temp | Press | Time | Observed A / C / N | P(Adhesive) | P(Cohesive) | P(None) |
|---|---|---|---|---|---|---|
| 180 | 40 | 10 | 2 / 1 / 1 | 0.6637 | 0.0873 | 0.2490 |
| 220 | 40 | 10 | 1 / 0 / 3 | 0.1615 | 0.0478 | 0.7907 |
| 180 | 60 | 10 | 2 / 0 / 2 | 0.3753 | 0.0885 | 0.5362 |
| 220 | 60 | 10 | 0 / 0 / 4 | 0.0496 | 0.0263 | 0.9241 |
| 180 | 40 | 20 | 1 / 2 / 1 | 0.1452 | 0.5926 | 0.2622 |
| 220 | 40 | 20 | 0 / 1 / 3 | 0.0296 | 0.2722 | 0.6981 |
| 180 | 60 | 20 | 0 / 2 / 2 | 0.0658 | 0.4815 | 0.4526 |
| 220 | 60 | 20 | 0 / 1 / 3 | 0.0093 | 0.1536 | 0.8370 |
The two failure modes live at opposite ends of Time. Adhesive is most likely at 180, 40, 10, the coldest, lowest, shortest corner, at 0.6637. Cohesive is most likely at 180, 40, 20, the same corner with the long cure, at 0.5926. A hold is most likely at 220, 60, 10, at 0.9241, with 220, 60, 20 next at 0.8370.
Nothing predicts a probability of 0 or 1. The cell where all four runs held, 220, 60, 10, is given 0.9241 rather than certainty, which is the same property of the logistic form the two-outcome engine has.
Things to try next¶
- Change the Ref. level cell to Adhesive and run again. Every coefficient changes and the whole probability table above stays exactly as it is, along with the log likelihood, G and both goodness of fit statistics. That is the clearest way to see what the baseline is and is not.
- Collapse Adhesive and Cohesive into one Fail and run again. Two outcomes means binary logistic runs instead, and Time's opposite effects on the two failure modes partly cancel in it.
- Add the three two-factor interactions. That is six more parameters, not three, because every term is fitted once per non-reference outcome. Watch BIC.
- Read the Math Details for how the coefficients are found, and Regression Results for every column on the report.
See Also¶
- Nominal Logistic Regression
- Options, what governs a run
- Regression Results
- Math Details
- Run Regression