Calculating Degrees of Freedom
One independent variable - df = (r-1), where r equals the number of levels of the independent variable
Two independent variables - df = (r-1) (s-1), where r and s are the number of levels of the first and second independent variables, respectively
Three independent variables - df = (r-1) (s-1) (t-1), where r, s and t are the number of levels of the first, second and third independent variables, respectively.