How do I prevent a stepwise multiple linear regression to include interaction terms?
Mostra commenti meno recenti
Hello everyone,
I am trying to do exploratory regression to see which of my recorded variables can be used to predict output. I have 12 predictor variables (stored in X) and 1 outcome/response variable (in y).
The problem is, when I use a constant linear model
mdl1 = stepwiselm(X,y,'constant')
I only get one predictive term, which does not have a very high R_squared value (0.28).
However, if I start off with a linear model,
mdl2 = stepwiselm(X,y,'linear')
the stepwise regression gives me a result with various interaction terms, which seem to be impossible to interpret in this context, albeit with a larger R_squared value.
Is there a way that I can prevent the stepwise analysis from including these interaction terms, and just limit it to linear and quadratic terms? I have a feeling it might have something to do with the 'upper' argument, but I can not figure it out.
Thank you.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Linear and Nonlinear Regression in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!