Home / DOE / Analyze / Run Regression / Run Regression How-To
Run Regression How-To¶
This walkthrough fits a model to a real set of sixteen runs and reads the regression sheet it writes, number by number, so you can check every one against your own sheet.
Every chart in this family is drawn from a fitted model, so the walkthrough starts by building one. The same experiment is used on all ten chart walkthroughs, so once you have the regression sheet you can work through any of the others without setting the data up again.
The data is on this page rather than in a file to download. Press Copy for Excel, then paste it into a blank worksheet.
The data¶
A three factor experiment on a bonding process, run twice through. Temp is in degrees C, Press in psi and Time in seconds, and the response Strength is the peel strength of the finished bond. Each of the eight factor combinations was run twice, giving 16 runs.
| Temp | Press | Time | Strength |
|---|---|---|---|
| 180 | 40 | 10 | 49.5 |
| 220 | 40 | 10 | 65.4 |
| 180 | 60 | 10 | 61.8 |
| 220 | 60 | 10 | 66.8 |
| 180 | 40 | 20 | 52.3 |
| 220 | 40 | 20 | 70.7 |
| 180 | 60 | 20 | 60.7 |
| 220 | 60 | 20 | 70.0 |
| 180 | 40 | 10 | 50.6 |
| 220 | 40 | 10 | 66.4 |
| 180 | 60 | 10 | 61.2 |
| 220 | 60 | 10 | 67.2 |
| 180 | 40 | 20 | 51.4 |
| 220 | 40 | 20 | 67.1 |
| 180 | 60 | 20 | 61.9 |
| 220 | 60 | 20 | 71.6 |
Each factor takes exactly two values, so this is a full factorial of the three at two levels each, replicated once. That matters for more than one chart: a factor with exactly two observed values is the only kind that can carry a Cube Plot axis, and a design with centre points would have failed that test.
Steps¶
-
Put the data in Excel
Press Copy for Excel above the table. In Excel, open a blank worksheet, click cell A1, and press Ctrl+V. You should have headers in row 1 and the 16 runs in rows 2 through 17.
-
Make a design sheet to hold it
From the Excel ribbon: QXL DOE New > Create Design > Special > Create Custom Design.
On the first page set the number of factors to 3 and the number of runs to 16. On the second page set the number of outputs to 1. That gives you an empty design sheet of the right shape, which is how data collected outside Quantum XL gets analysed.
-
Fill in the design sheet
Copy the four columns of data into the three factor columns and the one output column. Name the factors Temp, Press and Time, and the output Strength, so the names on your charts match the ones quoted below.
-
Answer the two questions a custom design asks
A custom design does not record how it was built, so the first time you run a regression, run Optimize, or open Modify Design on it, Quantum XL asks for what the sheet cannot say, and stores your answers so it never asks again.
On the first page leave Type: at Quantitative for all three factors. On the second, the interaction editor, move AB, AC and BC from Interactions available into Interactions in model: three main effects plus those three interactions is the model every walkthrough below assumes. The remaining degrees of freedom fall as you add each one, because the sixteen runs are fixed and every term spends one.
Afterwards the same editor is reachable at any time from QXL DOE New > Modify Design > Inputs > Add/Remove Interactions.
-
Run the regression
QXL DOE New > Analyze Design > Run Regression. A worksheet called Regression is added after the design sheet, and it is the sheet the walkthroughs below read.
What to read first, and in what order¶
The model, before any coefficient. The regression sheet names the terms that were fitted. Confirm it is the model you meant: here that is the three main effects plus AB, AC and BC.
Then the coefficient table. If yours matches this, everything else on the sheet will match too.
Check the coefficient table on the Regression sheet against this first. If these numbers match, every number quoted further down will match too; if they do not, the design was not entered the way this walkthrough assumes and nothing below will line up.
| Term | Coefficient | Standard error | t | p |
|---|---|---|---|---|
| Constant | 62.1625 | 0.2912 | 213.477 | 0.000000 |
| Temp (A) | 5.9875 | 0.2912 | 20.562 | 0.000000 |
| Press (B) | 2.9875 | 0.2912 | 10.260 | 0.000003 |
| Time (C) | 1.0500 | 0.2912 | 3.606 | 0.005696 |
| AB | -2.2375 | 0.2912 | -7.684 | 0.000030 |
| AC | 0.6500 | 0.2912 | 2.232 | 0.052506 |
| BC | -0.1500 | 0.2912 | -0.515 | 0.618877 |
The fitted equation is
Strength = 62.1625 + 5.9875 A + 2.9875 B + 1.0500 C - 2.2375 AB + 0.6500 AC - 0.1500 BC
in coded units, where each factor runs from -1 at its low value to +1 at its high value.
Every standard error is the same 0.2912. That is not a coincidence and it is a useful sign that the design was entered correctly: on a balanced full factorial every coded column is orthogonal to every other and carries the same amount of information, so every coefficient is estimated equally precisely.
Then R-squared and adjusted R-squared, which on this fit are 0.9854 and 0.9756, with a residual standard deviation of 1.1648. R-squared says how much of the response variation the fit accounts for. Adjusted R-squared is the one to compare between models with different term counts, because it charges for each term added, and the section below uses it to do exactly that.
Then the analysis of variance table:
| Source | df | Sum of squares | Mean square | F | p |
|---|---|---|---|---|---|
| Regression | 6 | 821.2675 | 136.8779 | 100.893 | 0.000000 |
| Residual error | 9 | 12.2100 | 1.3567 | ||
| Lack of fit | 1 | 1.9600 | 1.9600 | 1.530 | 0.251224 |
| Pure error | 8 | 10.2500 | 1.2813 | ||
| Total | 15 | 833.4775 |
The lack-of-fit block has something to say here, and it only does because the design is replicated. Pure error is the variation between runs made at identical settings, which no model could explain: eight pairs of runs, one degree of freedom each, eight in total. Lack of fit is whatever is left of the residual, and the F ratio of the two asks whether the leftover is bigger than the noise. At p = 0.2512 it is not, so there is no evidence that the model is missing a term the design could have found.
A single-replicate design with no centre points has no pure error at all, and the lack-of-fit block is then blank. That is expected rather than an error: with eight runs and this model there are no two runs at the same settings to measure noise between.
Now reduce the model, and watch the right statistic¶
BC is the weakest term on the sheet, a coefficient of -0.1500 at p = 0.618877. Remove it with QXL DOE New > Modify Design > Inputs > Add/Remove Interactions and run the regression again.
| Full model | BC removed | |
|---|---|---|
| R-squared | 0.9854 | 0.9849 |
| Adjusted R-squared | 0.9756 | 0.9774 |
| Residual standard deviation | 1.1648 | 1.1212 |
| p value on AC | 0.052506 | 0.042844 |
R-squared went down and adjusted R-squared went up. R-squared can never rise when a term is removed, which is why it cannot be used to choose between models of different sizes. Adjusted R-squared rose because the degree of freedom BC was spending bought less than it cost.
AC crossed 0.05 without its own coefficient changing. It is still 0.6500. What changed is the residual standard deviation the test divides by, which fell from 1.1648 to 1.1212 when BC's share of the residual was returned to the error term.
What the engine choice depends on¶
You do not choose it. Strength is quantitative, so ordinary least squares runs. Declare an output with two outcomes and binary logistic runs instead; three or more unordered outcomes and nominal logistic runs. The type on the sheet is the whole of the decision.
Things to try next¶
- Run it again on the same sheet. The regression is rewritten rather than added to, so there is one regression sheet per design sheet and no accumulation.
- Run Uncoded Coefficients on the same design and compare the two coefficient columns. The fit is the same; the units are not.
- Read the DOE Advisor block below the regression, which reads this fit and reports what it noticed. It is on by default and is described on The DOE Advisor.
- Turn the Advisor off on the Regression page of QXL DOE New > Options and run again. The block disappears and nothing else changes.
See Also¶
- Run Regression
- Options, what governs a run
- The DOE Advisor