cellstats(Term), Term a CHARACTER scalar of form "A.B. ...", where A, B, ... are factors in current GLM model. |

cellstats(Term) computes statistics for each cell of the multiway layout indicated by the term in the CHARACTER variable Term. The term must be made of factors in the model used by the most recent GLM (generalized linear or linear model) command such as regress(), anova(), or poisson(). It omits all cases for which there is any MISSING data in either the left or right hand sides of the model. cellstats() and tabs() do almost the same thing and generally tabs() is to be preferred. When Term is, say, "a.b.c" where a, b, and c are factors in the most recent GLM, and y is the response variable in the model, cellstats(Term) is almost equivalent to tabs(y, a, b, c). cellstats() and tabs() will differ only when (a) the response variable y is multivariate (has more than 1 column) and (b) there are MISSING data in y. cellstats() omits completely any row of y that contains any MISSING data; tabs() uses all non-MISSING data available and thus the cell count can differ among the columns of y. Except in this case, you should probably use tabs() in preference to cellstats() since tabs() has additional options and can be used independently of any GLM command. Even in this case, tabs() is preferable if you want cell statistics that use all the data. Of course, both cellstats() and tabs() omit all cases for which any of the factors are MISSING (how could they determine the cell?). Example: Cmd> anova("y=a+b+c+b.c") ; cellstats("b.c") # or tabs(y,b,c) gives cell statistics for the b.c term. See also topics 'glm', tabs().

Gary Oehlert 2003-01-15