find the best linear regression model using stepwiselm
Ältere Kommentare anzeigen
Hi all;
sp I have a table with the response variable bein 'VNAF'. I have 9 other predictors and I'm trying to use stepwiselm to find the best linear regression model according to highest Rsquared. I want to add all the possible interaction terms and also quadratic terms, This is my code:
fileName = 'Aim1Data_CMC5_noRRA_individuals.xlsx';
T = readtable(fileName,'ReadRowNames',true);
mdl = stepwiselm(T,'quadratic','ResponseVar','VNAF','Criterion','rsquared')
This gives me an Rsquared of 0.705.
while the simple linea regression mdoel gives me a R2 of 0.67.
My first question is that if I'm using stepwiselm right? meaning that my code includes all the interaction terms and quadratic terms for all the predictors?
my second question is that how I can improve my Rsquared? Does step function help? if so, what should I specify in it?
Thank you all
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Linear Predictive Coding finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!