Home / DOE / Analyze / Ordinary Least Squares Regression / Ordinary Least Squares Regression How-To
Ordinary Least Squares Regression How-To¶
This walkthrough runs this engine and reads the parts of its report that the other two engines do not have. You never select the engine. Run Regression chose it here because the output's declared type is quantitative, so the walkthrough is about setting that type and reading what comes back.
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.
Strength is a measured peel strength, so its Type: is Quantitative, which is the whole of what picks this engine. You do not have to set it: a new output arrives named Output 1 and typed Quantitative, so the steps below only rename it. Change it later on QXL DOE New > Modify Design > Outputs and a different engine runs.
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.
Confirm the engine that ran¶
The report names it. 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.
There is no convergence line on this report, and there should not be: least squares solves in one step. The two logistic engines iterate and report how the iteration went; this one has nothing to say about it.
Check the fit¶
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.
The three things on this report that the logistic engines do not have¶
Every variance inflation factor is exactly 1¶
The report carries a variance inflation factor per term, and on this design all six are 1.000000.
That is what a balanced full factorial buys, and it is worth checking rather than assuming. A VIF of 1 says the term's coded column carries no information that the other columns already carry, so its coefficient is estimated as precisely as it could be from sixteen runs. A VIF above 1 says two terms are partly telling you the same thing, and above 10 the coefficients can come back with the wrong sign.
It is also why every standard error on the coefficient table is the same 0.2912. Orthogonal columns, equal information, equal precision.
The residual variation splits into pure error and lack of fit¶
This design has eight settings run twice, so the report can separate the noise from the misfit: pure error 10.25 on 8 degrees of freedom, lack of fit 1.96 on 1, an F of 1.530 and a p value of 0.2512. Full reading of that block is on Run Regression How-To.
That is the one part of the report that can say the model is the wrong shape rather than merely imprecise, and it exists only because the design is replicated.
Per-run diagnostics, and one run that stands out¶
The report gives every run a fitted value, residuals in several scaled forms, a leverage and a Cook's distance. On this fit:
| Diagnostic | What this design gives | Why |
|---|---|---|
| Leverage | 0.4375 on all sixteen runs | seven terms over sixteen runs. A balanced design spreads influence equally, so no run is in a position to pull the fit on its own |
| Largest standardized residual | -2.4612, on run 14 | run 14 measured 67.1 where the model predicts 69.25 |
| Largest Cook's distance | 0.6730, also run 14 |
Run 14 is the one to look at, and its pair is what makes it interesting. Run 6 was made at the same settings, 220 C, 40 psi, 20 s, and returned 70.7 against run 14's 67.1. The two disagree by 3.6 where the residual standard deviation is 1.16, so the model splits the difference and neither run fits it well.
A large standardized residual is a finding, not a verdict. It can mean a mistake in the run, a real effect the model does not carry, or ordinary variation, and the report cannot tell you which. The DOE Advisor flags this same run for the same reason.
What least squares needs before you quote a p value¶
The fit itself needs only independent columns. The standard errors, the t statistics and the p values need more: residuals independent of each other, of constant spread across the fitted range, and roughly normal.
None of that is checked for you. Run Residual Plots on this fit before quoting any p value from it.
Things to try next¶
- Ask for a model this design cannot support. Add a term that the sixteen runs cannot tell apart from another and the run stops and reports that the X matrix is rank deficient. That is a property of the design and the requested model together, not an error in the data.
- Change Type: to Binary and run again. Binary logistic runs instead, which is the clearest way to see that the type is the whole of the decision.
- Read the Math Details for what the coefficients mean in this engine.
See Also¶
- Ordinary Least Squares Regression
- Options, what governs a run
- Regression Results for OLS, every column on the report
- Math Details
- Run Regression