Variable length & Stepwise regression
1 次查看(过去 30 天)
显示 更早的评论
I want to create a dataset
A = dataset('File',Araa06.txt');
Matlab returens errors:
Misuse dataset/readFile (line 207) Variable lengths must all be the same.
Error dataset (line 351) a = readFile(a,fileArg,otherArgs)
What could be the problem?
If I want to use dataset A for stepwise regression
mdl=stepwiselm(A,'Predictor variables','DEM','grad','Response variable','Yield')
What is the different between this one and
stepwise
If I just want to do stepwise regression, do I really need to build a model?
0 个评论
采纳的回答
Roger Wohlwend
2014-9-19
If you copy the contents of your txt-file and paste it into an Excel file, you see that not all numbers are separated by a tab. Some are separated by blanks. I guess that is why Matlab cannot read the txt file properly. It expects all numbers to be separated by tabs. So you have to fix the txt file first.
For stepwise regression you can use either stepwiselm or stepwise. They are basically the same. The latter offers you a GUI, the first is a class. I would recommend stepwiselm. You don't need a GUI. Just work with the class.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!