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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!