find the best linear regression model using stepwiselm
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Predictive Coding 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!