Comparing 2 linear models

조회 수: 6 (최근 30일)
patrick Joyce
patrick Joyce 2015년 8월 7일
편집: Walter Roberson 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