stepwise regression: Undefined function ' stepwiselm' for input arguments of type 'cell'.
Mostrar comentarios más antiguos
I have one .txt file and converted to first a table Ta(Ta=readtable('xxx.txt')) then an array Aa(Aa=table2array(Ta)), the .txt file contains 220 rows and 12 cols, but the table and the array only have 219 rows and 1 col. Where did I do wrong?
Then when I tried to do stepwise regression I got error message: Undefined function ' stepwiselm' for input arguments of type 'cell'.
My coad was: mdl=stepwiselm(Aa)
In the .txt file, the first raw are texts e.g. elevation, hight, yields etc. I though I could use these names to define Predictor variables and Response variable. But since these names are lost in Aa, how should I write code for stepwise regression?
2 comentarios
Roger Wohlwend
el 18 de Sept. de 2014
Please attach the file to your question.
Respuestas (1)
Roger Wohlwend
el 18 de Sept. de 2014
I recommend using a dataset for your problem.
A = dataset('File','excercise-data333.txt');
A dataset is a kind of table. The headers do not get lost and you can easily address a column (for expample: b = A.yield or c = A.x). The function stepwiselm accepts datasets as first argument.
3 comentarios
Yaojiayin
el 18 de Sept. de 2014
Roger Wohlwend
el 18 de Sept. de 2014
Hard to tell. The function can handle missing values, so that cannot be the problem. I have no idea.
Yaojiayin
el 18 de Sept. de 2014
Categorías
Más información sobre Model Building and Assessment en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!