Comparing 2 linear models

6 次查看(过去 30 天)
patrick Joyce
patrick Joyce 2015-8-7
Hi, I need to compare whether 2 linear models are significantly different from each other. I am fairly new to Matlab and am struggling to understand why I can't get a difference. Here is my code:
Good = isnan(yh_col) + isnan(u_col);
mdl = fitlm(yh_col(Good==0), u_col(Good==0), 'poly3');
figure
plot (mdl)
Goodf = isnan(yf_col) + isnan(ufished_col);
mdlf = fitlm(yf_col(Goodf==0), ufished_col(Goodf==0), 'poly3');
hold on
plot (yf_col, ufished_col, 'bo')
plot (mdlf)
hold off
anova2(mdl, mdlf)
As I say, I have 2 linear models and wish to compare their differences.
Any help is greatly appreciated!
Thanks.
  1 个评论
Uladzimir
Uladzimir 2015-8-7
Hi Patrick. I would recommend you to try "compare" function.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Analysis of Variance and Covariance 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by