MATLAB Answers


degrees of freedom for random factors in anovan

Asked by laurie
on 3 Apr 2014
Latest activity Commented on by laurie
on 3 Apr 2014

"anovan" seems to give the same number of degrees of freedom to a factor whether it is declared as random or fixed.

I thought that random factors "cost" less degrees of freedom. At least this is what happens in regression with mixed effects.

Any clues? Is this normal behavior?


1 Answer

Answer by Shashank Prasanna
on 3 Apr 2014
 Accepted answer

Laurie, anovan uses method of moments unlike in mixed-effects models which may use ML or REML. If you are interested in the latter, you may want to use:

here the degrees of freedom will be equal to n – p, where n is the number of observations and p is ONLY the number of fixed effects, not random effects.

  1 Comment

on 3 Apr 2014

Ok, so this is a normal behavior! I thought I was doing something wrong with the model specification in anovan. Well, that's a shame. Thanks :-)

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!