Missing anova function Statistics and Machine Learning Toolbox

조회 수: 14 (최근 30일)
Azadeh Sharafi
Azadeh Sharafi 2016년 8월 24일
댓글: Swarooph 2016년 8월 31일
I checked using "ver" command and I have Statistics and Machine Learning Toolbox Version 10.2(R2016a). but I couldn't find "anova" function. "exist anova" return 0 while "exist anova1" return 2. how could I reinstall the toolbox?

채택된 답변

Swarooph
Swarooph 2016년 8월 30일
anova is a function (method) that is embedded inside the class CompactLinearModel. That is why we are unable to find it using exist or which for that matter. anova1 however is a standalone function that is why we are able to find it. Try an example code to see if it works. For e.g. the following one from the doc page here:
X = randn(100,5);
y = X*[1;0;3;0;-1]+randn(100,1);
mdl = fitlm(X,y);
tbl = anova(mdl)

추가 답변 (1개)

Azadeh Sharafi
Azadeh Sharafi 2016년 8월 30일
Thanks, That worked. So basically I can only use anova with fitlm model? I tried fit command and got the error "Undefined function 'anova' for input arguments of type 'cfit'."
  댓글 수: 1
Swarooph
Swarooph 2016년 8월 31일
Disclaimer: I don't know enough about anova to completely answer this.
However, when you search for it in the documentation, you see 4 different results for anova. So it seems like it can work on CompactLinearModel through functions such as fitlm, RepeatedMeasuresModel through functions such as fitrm, LinearMixedModel through functions such as fitlme and GeneralizedLinearMixedModel through functions such as fitglme.

댓글을 달려면 로그인하십시오.

카테고리

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