MATLAB: Missing anova function Statistics and Machine Learning Toolbox

anovamissing functionStatistics and Machine Learning Toolbox

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?

Best Answer

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)