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 */
30 #include <gsl/gsl_histogram.h>
52 struct moments1 *moments;
54 gsl_histogram *histogram;
61 /* A hash of data for this factor.
63 struct hsh_table *ordered_data;
65 /* A Pointer to this hash table AFTER it has been SORTED and crunched */
66 struct weighted_value **wvp;
69 /* The number of values in the above array
70 (if all the weights are 1, then this will
78 void metrics_precalc(struct metrics *m);
80 void metrics_calc(struct metrics *m, const union value *f, double weight,
83 void metrics_postcalc(struct metrics *m);
86 /* Linked list of case nos */
90 struct case_node *next;
100 /* The cumulative weight */
106 /* Linked list of cases nos which have this value */
107 struct case_node *case_nos;
112 struct weighted_value *weighted_value_create(void);
114 void weighted_value_free(struct weighted_value *wv);
118 struct factor_statistics {
120 /* The values of the independent variables */
123 /* The an array stats for this factor, one for each dependent var */
129 /* Create a factor statistics object with for N dependent vars
130 and ID as the value of the independent variable */
131 struct factor_statistics *
132 create_factor_statistics (int n, union value *id0, union value *id1);
135 void factor_statistics_free(struct factor_statistics *f);
138 /* Compare f0 and f1.
139 width is the width of the independent variable */
141 factor_statistics_compare(const struct factor_statistics *f0,
142 const struct factor_statistics *f1, int width);
147 factor_statistics_hash(const struct factor_statistics *f, int width);