Negative R² when computing statistics in regress-function
显示 更早的评论
I'm using the regress function to calculate the regression factor and would like to take a look at the R².
[b,bint,r,rint,stats] = regress(y,X)
Stats should provide the R² and other statistical values. In my case R² is negative, which makes no sense for me. The help tells me "When computing statistics, X should include a column of 1s so that the model contains a constant term."
I don't know how this should look like...my data are just 2 columns. Should I just add an extra column in X with only 1s?? Does someone know what this means and why I have to do that?!
Thanks for any help, Andreas
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!