Degrees of Freedom in One-Way Anova by Rows



Package: Gnumeric
Version: 0.57 (CVS)

When data for a One-Way ANOVA are grouped by rows (instead of the
default columns) the degrees of freedom are incorrectly calculated.  It
always uses the number of columns to calculate degrees of freedom (e.g.
degrees of freedom between categories (df_b) is currently # of columns
-1).   The problem can easily be fixed by changing "cols" to "vars" in
the code that calculates degrees of freedom,  assuming we're right that
"vars" is defined as the number of categories of data (rows OR columns).

Patch attached. Not sure what standards you use. It's simply the output
of 'diff -Naur  analysis-tools.c analysis-tools.new' with
analysis-tools.new (obviously) being my altered version of
analysis-tools.c. It's against the latest CVS version (as of today at
11:00EST).

Tyler Christensen
James Christensen
--- analysis-tools.c    Fri Nov  3 23:28:16 2000
+++ analysis-tools.new  Sat Nov  4 13:30:15 2000
@@ -2440,8 +2440,8 @@
                        current = current->next;
                }
        }
-       df_b = cols-1;
-       df_w = n_total - cols;
+       df_b = vars-1;
+       df_w = n_total - vars;
        df_t = n_total - 1;
        ms_b = ssb / df_b;
        ms_w = ssw / df_w;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]