Problem Calling Data While Using Linear Regression Model 'fitlm'
조회 수: 5 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
답변 (1개)
dpb
2020년 11월 8일
"this is [p]ossibly due to the Species column being a string column..."
That's exactly the problem. See
Coding systems for categorical variables in regression analysis for nice exposition.
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!