[R] Summary of multi-way tables: Bug?

Russell Reeve rreeve at liposcience.com
Tue Dec 17 23:32:03 CET 2002


The function summary.table seems to have a bug with the degrees of freedom calculation. summary.table calculates a Pearson chi-squared statistic to test for independence of the factors. Degrees of freedom are calculated as the product of the levels - 1; i.e., for a 2x3x3x2 table, we get df=(2-1)*(3-1)*(3-1)*(2-1) = 4, when one should get df=36-(2-1)-(3-1)-(3-1)-(2-1)-1 = 29. The test statistic is calculated correctly, however. I'm using version 1.5.0; has this been fixed for 1.6? 

As an alternative, loglin works correctly.

Russell Reeve, Ph.D.
Dir of Experimental Design, Analysis, and Quality
rreeve at liposcience.com




More information about the R-help mailing list