Fixed bug reporting the significance of paired value t-test.
[pspp-builds.git] / src / math / group.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2004 Free Software Foundation, Inc.
3
4    This program is free software: you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation, either version 3 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program.  If not, see <http://www.gnu.org/licenses/>. */
16
17
18 #ifndef GROUP_H
19 #define GROUP_H
20
21
22 #include <data/value.h>
23
24
25 /* Statistics for grouped data */
26 struct group_statistics
27   {
28     /* The value of the independent variable for this group */
29     union value id;
30
31     /* The arithmetic mean */
32     double mean;
33
34     /* Population std. deviation */
35     double std_dev;
36
37     /* Sample std. deviation */
38     double s_std_dev;
39
40     /* count */
41     double n;
42
43     double sum;
44
45     /* Sum of squares */
46     double ssq;
47
48     /* Std Err of Mean */
49     double se_mean;
50
51     /* Sum of differences */
52     double sum_diff;
53
54     /* Mean of differences */
55     double mean_diff ;
56
57     /* Running total of the Levene for this group */
58     double lz_total;
59
60     /* Group mean of Levene */
61     double lz_mean;
62
63
64     /* min and max values */
65     double minimum ;
66     double maximum ;
67   };
68
69
70
71
72 /* These funcs are useful for hash tables */
73
74 /* Return -1 if the id of a is less than b; +1 if greater than and
75    0 if equal */
76 int  compare_group (const struct group_statistics *a,
77                     const struct group_statistics *b,
78                     int width);
79
80 unsigned hash_group (const struct group_statistics *g, int width);
81
82 void  free_group (struct group_statistics *v, void *aux);
83
84
85
86 #endif