Problem Calling Data While Using Linear Regression Model 'fitlm'

3 ビュー (過去 30 日間)
Onur Sen
Onur Sen 2020 年 11 月 8 日
コメント済み: Onur Sen 2020 年 11 月 8 日
Hello
Hope you are swell.
Now, as the title suggests, I'm having trouble using the function 'fitlm'. Now in various examples avaliable in Matlab, they can call a column of data by specifying the title of that column.
I have imported my table (called Fish1) in which the first column includes the species of Fish (as a string) while other 6 columns have the properties of the fish such as weight, length and so on. Now my problem arises when I'm trying to set 'Species' column as a dependent variable (or response variable) while I set others as independent variables.
Now this is [p]ossibly due to the Species column being a string column but how can I make this work exactly? I'm considerably new to this stuff,
Thank you. Have a nice day!

回答 (1 件)

dpb
dpb 2020 年 11 月 8 日
"this is [p]ossibly due to the Species column being a string column..."
That's exactly the problem. See
  1 件のコメント
Onur Sen
Onur Sen 2020 年 11 月 8 日
I manually assigned numbers to each fish and proceeded that way and it seems I was using 'Dummy Variables' in some way. I see there is an option creating dummy variables in Matlab. I'll try to use those for better organized script.
Thank you very much that was very helpful!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeTables についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by