1 /* PSPP - A program for statistical analysis . -*-c-*-
3 Copyright (C) 2004 Free Software Foundation, Inc.
4 Author: John Darrington 2004
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 /* FIXME: These things should probably be amalgamated with the
26 group_statistics struct */
38 /* The cumulative weight */
69 /* An ordered arary of data for this factor */
70 struct hsh_table *ordered_data;
72 /* An SORTED array of weighted values */
73 struct weighted_value *wv;
78 struct factor_statistics {
80 /* The value of the independent variable for this factor */
81 const union value *id;
83 /* An array of metrics indexed by dependent variable */
84 struct metrics *stats;
90 void metrics_precalc(struct metrics *fs);
92 void metrics_calc(struct metrics *fs, const union value *f, double weight);
94 void metrics_postcalc(struct metrics *fs);
99 /* These functions are necessary for creating hashes */
101 int compare_indep_values(const struct factor_statistics *f1,
102 const struct factor_statistics *f2,
105 unsigned hash_indep_value(const struct factor_statistics *f, int width) ;
107 void free_factor_stats(struct factor_statistics *f, int width );