# What is stepwise linear regression? [duplicate]

I am reading about 'interaction effects on linear regression' here and came across 'stepwise linear regression'.

There are originally 5 predictors in the model. This means to say that by using the ordinary linear regression, we have $Y = c + a_iX_i$ where $i = 1,...,5$.

Then it says here: For the initial model, use the full model with all terms and their pairwise interactions.

The succeeding steps involve what it calls 'stepwise linear regression'.

I am confused by this statement. Can anyone please give an insight on what 'stepwise linear regression' is all about? What are its advantages and why does it need to be done?

• Stepwise regression is something that basically should not be used.
– Tim
Commented Dec 7, 2017 at 15:58
• Note that clicking on the stepwise-regression tag under your question provides a fairly simple explanation. Also note that most contributors to this site would argue against stepwise regression except in closely defined circumstances.
– EdM
Commented Dec 7, 2017 at 15:58
• I am entirely new to this. I have read the links above, though I have not understood it fully. Any reason why it is written in a Matlab documentation (and promoted) to be used? I searched it and the general consensus is this method is controversial.
– cgo
Commented Dec 7, 2017 at 16:17
• Even recently, thoughtful writers have allowed that stepwise regression can be useful in some cases. Many (if not all) multiple regression textbooks originally written between 1980 and 2010 or so will describe forward, backward, and all-subsets forms of stepwise regression in detail. Statistical software packages usually provide this capability.
– whuber
Commented Dec 7, 2017 at 16:46

Stepwise Linear Regression is a method by which you leave it up to a statistical model test each predictor variable in a stepwise fashion, meaning 1 is inserted into the model and kept if it "improves" the model. Improve is defined by the type of stepwise regression being done, this can be defined by AIC, BIC, or any other variables. If it worsens the model, the predictor is then taken out. It sort of does some work for you. DON'T SKIP THE NEXT PARAGRAPH!!!!

HOWEVER!!!! this method should be avoided. Nothing wrong with the mathematics, but the logical thinking about how and why each variable should be in a model is not taken into account. What is your reasoning for putting this or that variable in the model? Questions of that nature, to understand our uncertainty about some variable of interest is not accounted for by the stepwise process. These are questions that stepwise regression can't answer, and the variables it's based on to include/exclude variables can't do that either. People loved it before because they could dump 20+ predictor variables in and get an "equation", but they didn't know if it was good or not, and the thinking behind what was in the equation was lost. Otherwise, it's like predicting shoe size by ice cream scoops (totally bogus, even if r^2 = 1.00)

• +1 but this answer might be a bit harsh. As @whuber notes in a comment, stepwise regression can be useful in some circumstances. Even Frank Harrell allows for "limited backwards step-down variable selection if parsimony is more important than accuracy," but only as the 13th and last step of formulating a final predictive model (Regression Modeling Strategies, 2nd edition, page 97). Thoughtless use of stepwise regression, particularly when it is used to replace careful thinking about the subject matter, is certainly to be avoided.
– EdM
Commented Dec 7, 2017 at 17:45