msgstr ""
"Project-Id-Version: PSPP 0.3.1\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2004-10-24 14:03+0800\n"
+"POT-Creation-Date: 2004-10-26 18:37+0800\n"
"PO-Revision-Date: 2004-01-23 13:04+0800\n"
"Last-Translator: John Darrington <john@darrington.wattle.id.au>\n"
"Language-Team: John Darrington <john@darrington.wattle.id.au>\n"
msgid "Only USE ALL is currently implemented."
msgstr ""
-#: src/descript.c:98 src/frequencies.q:96 src/oneway.q:367 src/t-test.q:636
-#: src/t-test.q:659 src/t-test.q:748 src/t-test.q:1063
+#: src/descript.c:98 src/frequencies.q:96 src/oneway.q:367 src/t-test.q:634
+#: src/t-test.q:657 src/t-test.q:746 src/t-test.q:1061
msgid "Mean"
msgstr ""
msgstr ""
#: src/crosstabs.q:784 src/frequencies.q:1386 src/oneway.q:366
-#: src/t-test.q:635 src/t-test.q:658 src/t-test.q:749 src/t-test.q:1263
+#: src/t-test.q:633 src/t-test.q:656 src/t-test.q:747 src/t-test.q:1261
msgid "N"
msgstr ""
msgid "Statistic"
msgstr ""
-#: src/crosstabs.q:1069 src/oneway.q:249 src/oneway.q:664 src/t-test.q:900
-#: src/t-test.q:1069 src/t-test.q:1161
+#: src/crosstabs.q:1069 src/oneway.q:249 src/oneway.q:674 src/t-test.q:898
+#: src/t-test.q:1067 src/t-test.q:1159
msgid "df"
msgstr ""
msgid " 95%% Confidence Interval"
msgstr ""
-#: src/crosstabs.q:1116 src/t-test.q:904 src/t-test.q:1066 src/t-test.q:1164
+#: src/crosstabs.q:1116 src/t-test.q:902 src/t-test.q:1064 src/t-test.q:1162
msgid "Lower"
msgstr ""
-#: src/crosstabs.q:1117 src/t-test.q:905 src/t-test.q:1067 src/t-test.q:1165
+#: src/crosstabs.q:1117 src/t-test.q:903 src/t-test.q:1065 src/t-test.q:1163
msgid "Upper"
msgstr ""
msgid "Coefficients for contrast %d do not total zero"
msgstr ""
-#: src/oneway.q:213 src/t-test.q:331 src/t-test.q:408
+#: src/oneway.q:213 src/t-test.q:329 src/t-test.q:406
#, c-format
msgid "`%s' is not a variable name"
msgstr ""
msgid "Mean Square"
msgstr ""
-#: src/oneway.q:251 src/t-test.q:897
+#: src/oneway.q:251 src/t-test.q:895
msgid "F"
msgstr ""
msgid "ANOVA"
msgstr ""
-#: src/oneway.q:368 src/t-test.q:637 src/t-test.q:660 src/t-test.q:750
-#: src/t-test.q:1064
+#: src/oneway.q:368 src/t-test.q:635 src/t-test.q:658 src/t-test.q:748
+#: src/t-test.q:1062
msgid "Std. Deviation"
msgstr ""
-#: src/oneway.q:369 src/oneway.q:662
+#: src/oneway.q:369 src/oneway.q:672
msgid "Std. Error"
msgstr ""
msgid "Test of Homogeneity of Variances"
msgstr ""
-#: src/oneway.q:587
+#: src/oneway.q:597
msgid "Contrast Coefficients"
msgstr ""
-#: src/oneway.q:589 src/oneway.q:660
+#: src/oneway.q:599 src/oneway.q:670
msgid "Contrast"
msgstr ""
-#: src/oneway.q:658
+#: src/oneway.q:668
msgid "Contrast Tests"
msgstr ""
-#: src/oneway.q:661
+#: src/oneway.q:671
msgid "Value of Contrast"
msgstr ""
-#: src/oneway.q:663 src/t-test.q:899 src/t-test.q:1068 src/t-test.q:1160
+#: src/oneway.q:673 src/t-test.q:897 src/t-test.q:1066 src/t-test.q:1158
msgid "t"
msgstr ""
-#: src/oneway.q:665 src/t-test.q:901 src/t-test.q:1070 src/t-test.q:1162
+#: src/oneway.q:675 src/t-test.q:899 src/t-test.q:1068 src/t-test.q:1160
msgid "Sig. (2-tailed)"
msgstr ""
-#: src/oneway.q:697
+#: src/oneway.q:723
msgid "Assume equal variances"
msgstr ""
-#: src/oneway.q:701
+#: src/oneway.q:727
msgid "Does not assume equal"
msgstr ""
msgid "data> "
msgstr ""
-#: src/t-test.q:235
+#: src/t-test.q:233
msgid "TESTVAL, GROUPS and PAIRS subcommands are mutually exclusive."
msgstr ""
-#: src/t-test.q:252
+#: src/t-test.q:250
msgid "VARIABLES subcommand is not appropriate with PAIRS"
msgstr ""
-#: src/t-test.q:289
+#: src/t-test.q:287
msgid "One or more VARIABLES must be specified."
msgstr ""
-#: src/t-test.q:344
+#: src/t-test.q:342
#, c-format
msgid "Long string variable %s is not valid here."
msgstr ""
-#: src/t-test.q:361
+#: src/t-test.q:359
msgid ""
"When applying GROUPS to a string variable, at least one value must be "
"specified."
msgstr ""
-#: src/t-test.q:443
+#: src/t-test.q:441
#, c-format
msgid ""
"PAIRED was specified but the number of variables preceding WITH (%d) did not "
"match the number following (%d)."
msgstr ""
-#: src/t-test.q:460
+#: src/t-test.q:458
msgid "At least two variables must be specified on PAIRS."
msgstr ""
-#: src/t-test.q:633
+#: src/t-test.q:631
msgid "One-Sample Statistics"
msgstr ""
-#: src/t-test.q:638 src/t-test.q:661 src/t-test.q:751
+#: src/t-test.q:636 src/t-test.q:659 src/t-test.q:749
msgid "SE. Mean"
msgstr ""
-#: src/t-test.q:655
+#: src/t-test.q:653
msgid "Group Statistics"
msgstr ""
-#: src/t-test.q:745
+#: src/t-test.q:743
msgid "Paired Sample Statistics"
msgstr ""
-#: src/t-test.q:767 src/t-test.q:1089 src/t-test.q:1280
+#: src/t-test.q:765 src/t-test.q:1087 src/t-test.q:1278
#, c-format
msgid "Pair %d"
msgstr ""
-#: src/t-test.q:885
+#: src/t-test.q:883
msgid "Independent Samples Test"
msgstr ""
-#: src/t-test.q:893
+#: src/t-test.q:891
msgid "Levene's Test for Equality of Variances"
msgstr ""
-#: src/t-test.q:895
+#: src/t-test.q:893
msgid "t-test for Equality of Means"
msgstr ""
-#: src/t-test.q:898 src/t-test.q:1265
+#: src/t-test.q:896 src/t-test.q:1263
msgid "Sig."
msgstr ""
-#: src/t-test.q:902 src/t-test.q:1163
+#: src/t-test.q:900 src/t-test.q:1161
msgid "Mean Difference"
msgstr ""
-#: src/t-test.q:903
+#: src/t-test.q:901
msgid "Std. Error Difference"
msgstr ""
-#: src/t-test.q:908 src/t-test.q:1060 src/t-test.q:1155
+#: src/t-test.q:906 src/t-test.q:1058 src/t-test.q:1153
#, c-format
msgid "%g%% Confidence Interval of the Difference"
msgstr ""
-#: src/t-test.q:939
+#: src/t-test.q:937
msgid "Equal variances assumed"
msgstr ""
-#: src/t-test.q:992
+#: src/t-test.q:990
msgid "Equal variances not assumed"
msgstr ""
-#: src/t-test.q:1050
+#: src/t-test.q:1048
msgid "Paired Samples Test"
msgstr ""
-#: src/t-test.q:1053
+#: src/t-test.q:1051
msgid "Paired Differences"
msgstr ""
-#: src/t-test.q:1065
+#: src/t-test.q:1063
msgid "Std. Error Mean"
msgstr ""
-#: src/t-test.q:1144
+#: src/t-test.q:1142
msgid "One-Sample Test"
msgstr ""
-#: src/t-test.q:1149
+#: src/t-test.q:1147
#, c-format
msgid "Test Value = %f"
msgstr ""
-#: src/t-test.q:1260
+#: src/t-test.q:1258
msgid "Paired Samples Correlations"
msgstr ""
-#: src/t-test.q:1264
+#: src/t-test.q:1262
msgid "Correlation"
msgstr ""
-#: src/t-test.q:1283
+#: src/t-test.q:1281
#, c-format
msgid "%s & %s"
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2004-10-24 14:03+0800\n"
+"POT-Creation-Date: 2004-10-26 18:37+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "Only USE ALL is currently implemented."
msgstr ""
-#: src/descript.c:98 src/frequencies.q:96 src/oneway.q:367 src/t-test.q:636
-#: src/t-test.q:659 src/t-test.q:748 src/t-test.q:1063
+#: src/descript.c:98 src/frequencies.q:96 src/oneway.q:367 src/t-test.q:634
+#: src/t-test.q:657 src/t-test.q:746 src/t-test.q:1061
msgid "Mean"
msgstr ""
msgstr ""
#: src/crosstabs.q:784 src/frequencies.q:1386 src/oneway.q:366
-#: src/t-test.q:635 src/t-test.q:658 src/t-test.q:749 src/t-test.q:1263
+#: src/t-test.q:633 src/t-test.q:656 src/t-test.q:747 src/t-test.q:1261
msgid "N"
msgstr ""
msgid "Statistic"
msgstr ""
-#: src/crosstabs.q:1069 src/oneway.q:249 src/oneway.q:664 src/t-test.q:900
-#: src/t-test.q:1069 src/t-test.q:1161
+#: src/crosstabs.q:1069 src/oneway.q:249 src/oneway.q:674 src/t-test.q:898
+#: src/t-test.q:1067 src/t-test.q:1159
msgid "df"
msgstr ""
msgid " 95%% Confidence Interval"
msgstr ""
-#: src/crosstabs.q:1116 src/t-test.q:904 src/t-test.q:1066 src/t-test.q:1164
+#: src/crosstabs.q:1116 src/t-test.q:902 src/t-test.q:1064 src/t-test.q:1162
msgid "Lower"
msgstr ""
-#: src/crosstabs.q:1117 src/t-test.q:905 src/t-test.q:1067 src/t-test.q:1165
+#: src/crosstabs.q:1117 src/t-test.q:903 src/t-test.q:1065 src/t-test.q:1163
msgid "Upper"
msgstr ""
msgid "Coefficients for contrast %d do not total zero"
msgstr ""
-#: src/oneway.q:213 src/t-test.q:331 src/t-test.q:408
+#: src/oneway.q:213 src/t-test.q:329 src/t-test.q:406
#, c-format
msgid "`%s' is not a variable name"
msgstr ""
msgid "Mean Square"
msgstr ""
-#: src/oneway.q:251 src/t-test.q:897
+#: src/oneway.q:251 src/t-test.q:895
msgid "F"
msgstr ""
msgid "ANOVA"
msgstr ""
-#: src/oneway.q:368 src/t-test.q:637 src/t-test.q:660 src/t-test.q:750
-#: src/t-test.q:1064
+#: src/oneway.q:368 src/t-test.q:635 src/t-test.q:658 src/t-test.q:748
+#: src/t-test.q:1062
msgid "Std. Deviation"
msgstr ""
-#: src/oneway.q:369 src/oneway.q:662
+#: src/oneway.q:369 src/oneway.q:672
msgid "Std. Error"
msgstr ""
msgid "Test of Homogeneity of Variances"
msgstr ""
-#: src/oneway.q:587
+#: src/oneway.q:597
msgid "Contrast Coefficients"
msgstr ""
-#: src/oneway.q:589 src/oneway.q:660
+#: src/oneway.q:599 src/oneway.q:670
msgid "Contrast"
msgstr ""
-#: src/oneway.q:658
+#: src/oneway.q:668
msgid "Contrast Tests"
msgstr ""
-#: src/oneway.q:661
+#: src/oneway.q:671
msgid "Value of Contrast"
msgstr ""
-#: src/oneway.q:663 src/t-test.q:899 src/t-test.q:1068 src/t-test.q:1160
+#: src/oneway.q:673 src/t-test.q:897 src/t-test.q:1066 src/t-test.q:1158
msgid "t"
msgstr ""
-#: src/oneway.q:665 src/t-test.q:901 src/t-test.q:1070 src/t-test.q:1162
+#: src/oneway.q:675 src/t-test.q:899 src/t-test.q:1068 src/t-test.q:1160
msgid "Sig. (2-tailed)"
msgstr ""
-#: src/oneway.q:697
+#: src/oneway.q:723
msgid "Assume equal variances"
msgstr ""
-#: src/oneway.q:701
+#: src/oneway.q:727
msgid "Does not assume equal"
msgstr ""
msgid "data> "
msgstr ""
-#: src/t-test.q:235
+#: src/t-test.q:233
msgid "TESTVAL, GROUPS and PAIRS subcommands are mutually exclusive."
msgstr ""
-#: src/t-test.q:252
+#: src/t-test.q:250
msgid "VARIABLES subcommand is not appropriate with PAIRS"
msgstr ""
-#: src/t-test.q:289
+#: src/t-test.q:287
msgid "One or more VARIABLES must be specified."
msgstr ""
-#: src/t-test.q:344
+#: src/t-test.q:342
#, c-format
msgid "Long string variable %s is not valid here."
msgstr ""
-#: src/t-test.q:361
+#: src/t-test.q:359
msgid ""
"When applying GROUPS to a string variable, at least one value must be "
"specified."
msgstr ""
-#: src/t-test.q:443
+#: src/t-test.q:441
#, c-format
msgid ""
"PAIRED was specified but the number of variables preceding WITH (%d) did not "
"match the number following (%d)."
msgstr ""
-#: src/t-test.q:460
+#: src/t-test.q:458
msgid "At least two variables must be specified on PAIRS."
msgstr ""
-#: src/t-test.q:633
+#: src/t-test.q:631
msgid "One-Sample Statistics"
msgstr ""
-#: src/t-test.q:638 src/t-test.q:661 src/t-test.q:751
+#: src/t-test.q:636 src/t-test.q:659 src/t-test.q:749
msgid "SE. Mean"
msgstr ""
-#: src/t-test.q:655
+#: src/t-test.q:653
msgid "Group Statistics"
msgstr ""
-#: src/t-test.q:745
+#: src/t-test.q:743
msgid "Paired Sample Statistics"
msgstr ""
-#: src/t-test.q:767 src/t-test.q:1089 src/t-test.q:1280
+#: src/t-test.q:765 src/t-test.q:1087 src/t-test.q:1278
#, c-format
msgid "Pair %d"
msgstr ""
-#: src/t-test.q:885
+#: src/t-test.q:883
msgid "Independent Samples Test"
msgstr ""
-#: src/t-test.q:893
+#: src/t-test.q:891
msgid "Levene's Test for Equality of Variances"
msgstr ""
-#: src/t-test.q:895
+#: src/t-test.q:893
msgid "t-test for Equality of Means"
msgstr ""
-#: src/t-test.q:898 src/t-test.q:1265
+#: src/t-test.q:896 src/t-test.q:1263
msgid "Sig."
msgstr ""
-#: src/t-test.q:902 src/t-test.q:1163
+#: src/t-test.q:900 src/t-test.q:1161
msgid "Mean Difference"
msgstr ""
-#: src/t-test.q:903
+#: src/t-test.q:901
msgid "Std. Error Difference"
msgstr ""
-#: src/t-test.q:908 src/t-test.q:1060 src/t-test.q:1155
+#: src/t-test.q:906 src/t-test.q:1058 src/t-test.q:1153
#, c-format
msgid "%g%% Confidence Interval of the Difference"
msgstr ""
-#: src/t-test.q:939
+#: src/t-test.q:937
msgid "Equal variances assumed"
msgstr ""
-#: src/t-test.q:992
+#: src/t-test.q:990
msgid "Equal variances not assumed"
msgstr ""
-#: src/t-test.q:1050
+#: src/t-test.q:1048
msgid "Paired Samples Test"
msgstr ""
-#: src/t-test.q:1053
+#: src/t-test.q:1051
msgid "Paired Differences"
msgstr ""
-#: src/t-test.q:1065
+#: src/t-test.q:1063
msgid "Std. Error Mean"
msgstr ""
-#: src/t-test.q:1144
+#: src/t-test.q:1142
msgid "One-Sample Test"
msgstr ""
-#: src/t-test.q:1149
+#: src/t-test.q:1147
#, c-format
msgid "Test Value = %f"
msgstr ""
-#: src/t-test.q:1260
+#: src/t-test.q:1258
msgid "Paired Samples Correlations"
msgstr ""
-#: src/t-test.q:1264
+#: src/t-test.q:1262
msgid "Correlation"
msgstr ""
-#: src/t-test.q:1283
+#: src/t-test.q:1281
#, c-format
msgid "%s & %s"
msgstr ""
file-handle.h \
file-type.c filename.c filename.h flip.c font.h format.c format.def \
format.h formats.c get.c getline.c getline.h glob.c glob.h \
-groff-font.c hash.c hash.h html.c htmlP.h include.c inpt-pgm.c lexer.c \
+groff-font.c group.c group.h group_proc.h \
+hash.c hash.h html.c htmlP.h include.c inpt-pgm.c lexer.c \
lexer.h levene.c levene.h log.h loop.c magic.c magic.h main.c main.h \
matrix-data.c mis-val.c misc.c misc.h modify-vars.c \
moments.c moments.h numeric.c output.c output.h pfm-read.c pfm-write.c \
pfm.h pool.c pool.h postscript.c print.c random.c random.h recode.c \
rename-vars.c repeat.c repeat.h sample.c sel-if.c settings.h \
sfm-read.c sfm-write.c sfm.h sfmP.h som.c som.h sort.c sort.h \
-split-file.c str.c str.h subclist.c \
+split-file.c str.c str.h subclist.c subclist.h \
sysfile-info.c tab.c tab.h temporary.c stat.h \
-title.c t-test.h val.h val-labs.c value-labels.c value-labels.h \
+title.c val.h val-labs.c value-labels.c value-labels.h \
var-labs.c var.h vars-atr.c vars-prs.c vector.c version.c version.h \
vfm.c vfm.h vfmP.h weight.c
--- /dev/null
+/* PSPP - computes sample statistics.
+ Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
+ Written by John Darrington <john@darrington.wattle.id.au>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "hash.h"
+#include "group.h"
+#include <string.h>
+
+
+/* Return -1 if the id of a is less than b; +1 if greater than and
+ 0 if equal */
+int
+compare_group(const struct group_statistics *a,
+ const struct group_statistics *b,
+ int width)
+{
+ int id_cmp = compare_values(&a->id, &b->id, width);
+
+ if (id_cmp == 0 )
+ {
+ int c;
+ c= memcmp(&a->criterion,&b->criterion,sizeof(enum comparison));
+ return c;
+ }
+ else
+ return id_cmp;
+}
+
+
+unsigned
+hash_group(const struct group_statistics *g, int width)
+{
+ unsigned id_hash;
+
+ if ( 0 == width )
+ id_hash = hsh_hash_double (g->id.f);
+ else
+ id_hash = hsh_hash_bytes (g->id.s, width);
+
+ return id_hash;
+}
+
+
+void
+free_group(struct group_statistics *v, void *aux)
+{
+ free(v);
+}
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
+
+
#ifndef GROUP_H
#define GROUP_H
+
#include "val.h"
};
+
+
+/* These funcs are usefull for hash tables */
+
+/* Return -1 if the id of a is less than b; +1 if greater than and
+ 0 if equal */
+int compare_group(const struct group_statistics *a,
+ const struct group_statistics *b,
+ int width);
+
+unsigned hash_group(const struct group_statistics *g, int width);
+
+void free_group(struct group_statistics *v, void *aux);
+
+
+
#endif
--- /dev/null
+/* PSPP - computes sample statistics.
+
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+ Written by John Darrington <john@darrington.wattle.id.au>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#ifndef GROUP_DATA_H
+#define GROUP_DATA_H
+
+#include "group.h"
+
+/* private data for commands dealing with grouped data*/
+struct group_proc
+{
+ /* Stats for the `universal group' (ie the totals) */
+ struct group_statistics ugs;
+
+ /* The number of groups */
+ int n_groups;
+
+ /* The levene statistic */
+ double levene ;
+
+ /* Stats for individual groups */
+ struct group_statistics *gs;
+
+ /* A hash of group statistics keyed by the value of the
+ independent variable */
+ struct hsh_table *group_hash;
+
+ /* Mean square error */
+ double mse ;
+
+};
+
+#endif
#include "vfm.h"
#include "alloc.h"
#include "misc.h"
-
+#include "group.h"
#include <math.h>
#include <stdlib.h>
static struct hsh_table **hash;
-
-/* Return -1 if the id of a is less than b; +1 if greater than and
- 0 if equal */
-static int
-compare_group(const struct group_statistics *a,
- const struct group_statistics *b,
- int width)
-{
- int id_cmp = compare_values(&a->id, &b->id, width);
-
- if (id_cmp == 0 )
- {
- int c;
- c= memcmp(&a->criterion,&b->criterion,sizeof(enum comparison));
- return c;
- }
- else
- return id_cmp;
-}
-
-
-static unsigned
-hash_group(const struct group_statistics *g, int width)
-{
- unsigned id_hash;
-
- if ( 0 == width )
- id_hash = hsh_hash_double (g->id.f);
- else
- id_hash = hsh_hash_bytes (g->id.s, width);
-
- return id_hash;
-}
-
/* Internal variables used in calculating the Levene statistic */
/* Per variable statistics */
{
struct variable *v = l->v_dep[i];
int g;
- int number_of_groups = v->p.t_t.n_groups ;
+ int number_of_groups = v->p.grp_data.n_groups ;
hash[i] = hsh_create (l->n_dep * number_of_groups,
(hsh_compare_func *) compare_group,
lz[i].total_n = 0;
lz[i].n_groups = number_of_groups;
- for (g = 0 ; g < v->p.t_t.n_groups ; ++g )
+ for (g = 0 ; g < v->p.grp_data.n_groups ; ++g )
{
- struct group_statistics *gs = &v->p.t_t.gs[g];
+ struct group_statistics *gs = &v->p.grp_data.gs[g];
gs->lz_total = 0;
hsh_insert(hash[i], gs);
if ( gs->criterion != CMP_EQ )
}
- lz_numerator *= ( l->v_dep[v]->p.t_t.ugs.n -
- l->v_dep[v]->p.t_t.n_groups );
+ lz_numerator *= ( l->v_dep[v]->p.grp_data.ugs.n -
+ l->v_dep[v]->p.grp_data.n_groups );
- lz_denominator[v] /= (l->v_dep[v]->p.t_t.n_groups - 1);
+ lz_denominator[v] /= (l->v_dep[v]->p.grp_data.n_groups - 1);
- l->v_dep[v]->p.t_t.levene = lz_numerator/lz_denominator[v] ;
+ l->v_dep[v]->p.grp_data.levene = lz_numerator/lz_denominator[v] ;
}
/* Now clear up after ourselves */
+++ /dev/null
-/* PSPP - computes sample statistics.
-
- Copyright (C) 2004 Free Software Foundation, Inc.
-
- Written by John Darrington <john@darrington.wattle.id.au>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-#ifndef ONEWAY_H
-#define ONEWAY_H
-
-/* ONEWAY private data */
-struct oneway_proc
-{
- /* Stats for the `universal group' (ie the totals) */
- struct group_statistics ugs;
-
- /* The number of groups */
- int n_groups;
-
- /* A hash of group statistics keyed by the value of the
- independent variable */
- struct hsh_table *group_hash;
-
- /* Mean square error */
- double mse ;
-
-};
-
-#endif
#include "vfm.h"
#include "hash.h"
#include "casefile.h"
-#include "oneway.h"
+#include "group_proc.h"
#include "group.h"
#include "levene.h"
/* Clean up */
for (i = 0 ; i < n_vars ; ++i )
{
- struct hsh_table *group_hash = vars[i]->p.ww.group_hash;
+ struct hsh_table *group_hash = vars[i]->p.grp_data.group_hash;
hsh_destroy(group_hash);
}
for ( i=0 ; i < n_vars ; ++i )
{
- struct group_statistics *totals = &vars[i]->p.ww.ugs;
- struct hsh_table *group_hash = vars[i]->p.ww.group_hash;
+ struct group_statistics *totals = &vars[i]->p.grp_data.ugs;
+ struct hsh_table *group_hash = vars[i]->p.grp_data.group_hash;
struct hsh_iterator g;
struct group_statistics *gs;
double ssa=0;
{
const double sst = totals->ssq - ( totals->sum * totals->sum) / totals->n ;
- const double df1 = vars[i]->p.ww.n_groups - 1;
- const double df2 = totals->n - vars[i]->p.ww.n_groups ;
+ const double df1 = vars[i]->p.grp_data.n_groups - 1;
+ const double df2 = totals->n - vars[i]->p.grp_data.n_groups ;
const double msa = ssa / df1;
- vars[i]->p.ww.mse = (sst - ssa) / df2;
+ vars[i]->p.grp_data.mse = (sst - ssa) / df2;
/* Sums of Squares */
/* Mean Squares */
tab_float (t, 4, i * 3 + 1, TAB_RIGHT, msa, 8, 3);
- tab_float (t, 4, i * 3 + 2, TAB_RIGHT, vars[i]->p.ww.mse, 8, 3);
+ tab_float (t, 4, i * 3 + 2, TAB_RIGHT, vars[i]->p.grp_data.mse, 8, 3);
{
- const double F = msa/vars[i]->p.ww.mse ;
+ const double F = msa/vars[i]->p.grp_data.mse ;
/* The F value */
tab_float (t, 5, i * 3 + 1, 0, F, 8, 3);
for ( v = 0 ; v < n_vars ; ++v )
- n_rows += vars[v]->p.ww.n_groups + 1;
+ n_rows += vars[v]->p.grp_data.n_groups + 1;
t = tab_create (n_cols,n_rows,0);
tab_headers (t, 2, 0, 2, 0);
struct hsh_iterator g;
struct group_statistics *gs;
- struct group_statistics *totals = &vars[v]->p.ww.ugs;
+ struct group_statistics *totals = &vars[v]->p.grp_data.ugs;
int count = 0 ;
char *s = (vars[v]->label) ? vars[v]->label : vars[v]->name;
- struct hsh_table *group_hash = vars[v]->p.ww.group_hash;
+ struct hsh_table *group_hash = vars[v]->p.grp_data.group_hash;
tab_text (t, 0, row, TAB_LEFT | TAT_TITLE, s);
tab_float(t, 8, row + count, 0, totals->minimum, 8, 2);
tab_float(t, 9, row + count, 0, totals->maximum, 8, 2);
- row += vars[v]->p.ww.n_groups + 1;
+ row += vars[v]->p.grp_data.n_groups + 1;
}
for ( v=0 ; v < n_vars ; ++v )
{
char *s = (vars[v]->label) ? vars[v]->label : vars[v]->name;
+ struct group_statistics *totals = &vars[v]->p.grp_data.ugs;
+
+ const double df1 = vars[v]->p.grp_data.n_groups - 1;
+ const double df2 = totals->n - vars[v]->p.grp_data.n_groups ;
+
tab_text (t, 0, v + 1, TAB_LEFT | TAT_TITLE, s);
+
+
+
+ tab_float (t, 2, v + 1, TAB_RIGHT, df1 ,8,0);
+ tab_float (t, 3, v + 1, TAB_RIGHT, df2 ,8,0);
}
tab_submit (t);
int ci;
double contrast_value = 0.0;
double coef_msq = 0.0;
- struct oneway_proc *ww = &vars[v]->p.ww ;
- struct hsh_table *group_hash = ww->group_hash;
+ struct group_proc *grp_data = &vars[v]->p.grp_data ;
+ struct hsh_table *group_hash = grp_data->group_hash;
struct hsh_iterator g;
struct group_statistics *gs;
TAB_RIGHT, contrast_value, 8,2);
- std_error_contrast = sqrt(vars[v]->p.ww.mse * coef_msq);
+ std_error_contrast = sqrt(vars[v]->p.grp_data.mse * coef_msq);
/* Std. Error */
tab_float (t, 4, (v * lines_per_variable) + i + 1,
TAB_RIGHT, T,
8,3);
- df = ww->ugs.n - ww->n_groups;
+ df = grp_data->ugs.n - grp_data->n_groups;
/* Degrees of Freedom */
tab_float (t, 6, (v * lines_per_variable) + i + 1,
static void precalc ( struct cmd_oneway *cmd UNUSED );
-int compare_group_id (const struct group_statistics *a,
- const struct group_statistics *b, int width);
-
-unsigned int hash_group_id(const struct group_statistics *v, int width);
-
-void free_group_id(struct group_statistics *v, void *aux UNUSED);
-
-
-
-
-int
-compare_group_id (const struct group_statistics *a,
- const struct group_statistics *b, int width)
-{
- return compare_values(&a->id, &b->id, width);
-}
-
-unsigned int
-hash_group_id(const struct group_statistics *v, int width)
-{
- return hash_value ( &v->id, width);
-}
-
-void
-free_group_id(struct group_statistics *v, void *aux UNUSED)
-{
- free(v);
-}
/* Pre calculations */
for(i=0; i< n_vars ; ++i)
{
- struct group_statistics *totals = &vars[i]->p.ww.ugs;
+ struct group_statistics *totals = &vars[i]->p.grp_data.ugs;
/* Create a hash for each of the dependent variables.
The hash contains a group_statistics structure,
and is keyed by value of the independent variable */
- vars[i]->p.ww.group_hash =
+ vars[i]->p.grp_data.group_hash =
hsh_create(4,
- (hsh_compare_func *) compare_group_id,
- (hsh_hash_func *) hash_group_id,
- (hsh_free_func *) free_group_id,
+ (hsh_compare_func *) compare_group,
+ (hsh_hash_func *) hash_group,
+ (hsh_free_func *) free_group,
(void *) indep_var->width );
+ totals->criterion = CMP_EQ;
totals->sum=0;
totals->n=0;
totals->ssq=0;
precalc(cmd);
+
+
for(r = casefile_get_reader (cf);
casereader_read (r, &c) ;
case_destroy (&c))
const union value *val = case_data (&c, v->fv);
- struct hsh_table *group_hash = vars[i]->p.ww.group_hash;
+ struct hsh_table *group_hash = vars[i]->p.grp_data.group_hash;
struct group_statistics *gs;
gs = (struct group_statistics *)
xmalloc (sizeof(struct group_statistics));
+ gs->criterion = CMP_EQ;
gs->id = *indep_val;
gs->sum=0;
gs->n=0;
if (! value_is_missing(val,v) )
{
- struct group_statistics *totals = &vars[i]->p.ww.ugs;
+ struct group_statistics *totals = &vars[i]->p.grp_data.ugs;
totals->n+=weight;
totals->sum+=weight * val->f;
gs->maximum = val->f * weight;
}
- vars[i]->p.ww.n_groups = hsh_count ( group_hash );
+ vars[i]->p.grp_data.n_groups = hsh_count ( group_hash );
}
}
postcalc(cmd);
+ /*
+ levene(cf, indep_var, n_vars, vars, LEV_LISTWISE, value_is_missing);
+ */
+
ostensible_number_of_groups = hsh_count (global_group_hash);
}
for(i = 0; i < n_vars ; ++i)
{
- struct hsh_table *group_hash = vars[i]->p.ww.group_hash;
- struct group_statistics *totals = &vars[i]->p.ww.ugs;
+ struct hsh_table *group_hash = vars[i]->p.grp_data.group_hash;
+ struct group_statistics *totals = &vars[i]->p.grp_data.ugs;
struct hsh_iterator g;
struct group_statistics *gs;
+++ /dev/null
-/* PSPP - computes sample statistics.
- Copyright (C) 2004 Free Software Foundation, Inc.
- Written by John Darrington <john@darrington.wattle.id.au>
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
-
-#ifndef T_TEST_H
-#define T_TEST_H
-
-#include "val.h"
-
-#include "group.h"
-
-/* T-TEST private data */
-struct t_test_proc
-{
- /* Stats for the `universal group' */
- struct group_statistics ugs;
-
- /* Number of groups */
- int n_groups ;
-
- /* Stats for individual groups */
- struct group_statistics *gs;
-
- /* The levene statistic */
- double levene ;
-};
-
-#endif
#include "var.h"
#include "vfm.h"
#include "hash.h"
-#include "t-test.h"
+#include "group_proc.h"
#include "casefile.h"
#include "levene.h"
/* Destroy any group statistics we created */
for (i= 0 ; i < cmd.n_variables ; ++i )
{
- free(cmd.v_variables[i]->p.t_t.gs);
+ free(cmd.v_variables[i]->p.grp_data.gs);
}
}
/* Fill in the group statistics */
for ( g=0; g < 2 ; ++g )
{
- struct group_statistics *gs = &cmd->v_variables[i]->p.t_t.gs[g];
+ struct group_statistics *gs = &cmd->v_variables[i]->p.grp_data.gs[g];
tab_float(ssb->t, 2 ,i*2+g+1, TAB_RIGHT, gs->n, 2, 0);
tab_float(ssb->t, 3 ,i*2+g+1, TAB_RIGHT, gs->mean, 8, 2);
{
struct group_statistics *gs;
- gs=&pairs[i].v[j]->p.t_t.ugs;
+ gs=&pairs[i].v[j]->p.grp_data.ugs;
/* Titles */
for (i=0; i < cmd->n_variables; ++i)
{
struct group_statistics *gs;
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
tab_text (ssb->t, 0, i+1, TAB_LEFT, cmd->v_variables[i]->name);
tab_float (ssb->t,1, i+1, TAB_RIGHT, gs->n, 2, 0);
double std_err_diff;
double mean_diff;
- struct group_statistics *gs0 = &cmd->v_variables[i]->p.t_t.gs[0];
- struct group_statistics *gs1 = &cmd->v_variables[i]->p.t_t.gs[1];
+ struct group_statistics *gs0 = &cmd->v_variables[i]->p.grp_data.gs[0];
+ struct group_statistics *gs1 = &cmd->v_variables[i]->p.grp_data.gs[1];
tab_text (self->t, 0, i*2+3, TAB_LEFT, cmd->v_variables[i]->name);
tab_float(self->t, 2, i*2+3, TAB_CENTER,
- cmd->v_variables[i]->p.t_t.levene, 8,3);
+ cmd->v_variables[i]->p.grp_data.levene, 8,3);
/* Now work out the significance of the Levene test */
- df1 = 1; df2 = cmd->v_variables[i]->p.t_t.ugs.n - 2;
- q = gsl_cdf_fdist_Q(cmd->v_variables[i]->p.t_t.levene, df1, df2);
+ df1 = 1; df2 = cmd->v_variables[i]->p.grp_data.ugs.n - 2;
+ q = gsl_cdf_fdist_Q(cmd->v_variables[i]->p.grp_data.levene, df1, df2);
tab_float(self->t, 3, i*2+3, TAB_CENTER, q, 8,3 );
double p,q;
double df;
struct group_statistics *gs;
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
tab_text (trb->t, 0, i+3, TAB_LEFT, cmd->v_variables[i]->name);
struct variable *v = cmd->v_variables[i];
const union value *val = case_data (c, v->fv);
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
if (! value_is_missing(val,v) )
{
for(i=0; i< cmd->n_variables ; ++i)
{
struct group_statistics *gs;
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
gs->sum=0;
gs->n=0;
for(i=0; i< cmd->n_variables ; ++i)
{
struct group_statistics *gs;
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
gs->mean=gs->sum / gs->n;
gs->s_std_dev= sqrt(
struct variable *v = cmd->v_variables[i];
const union value *val = case_data (c, v->fv);
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
if ( ! value_is_missing(val,v))
gs->sum_diff += weight * (val->f - cmd->n_testval);
for(i=0; i< cmd->n_variables ; ++i)
{
struct group_statistics *gs;
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
gs->sum_diff=0;
}
for(i=0; i< cmd->n_variables ; ++i)
{
struct group_statistics *gs;
- gs= &cmd->v_variables[i]->p.t_t.ugs;
+ gs= &cmd->v_variables[i]->p.grp_data.ugs;
gs->mean_diff = gs->sum_diff / gs->n ;
}
for(i=0; i< cmd->n_variables ; ++i)
{
- struct t_test_proc *ttpr = &cmd->v_variables[i]->p.t_t;
+ struct group_proc *ttpr = &cmd->v_variables[i]->p.grp_data;
/* There's always 2 groups for a T - TEST */
ttpr->n_groups = 2;
{
struct variable *var = cmd->v_variables[i];
- struct group_statistics *gs = &var->p.t_t.gs[g];
+ struct group_statistics *gs = &var->p.grp_data.gs[g];
const union value *val = case_data (c, var->fv);
for (j=0 ; j < 2 ; ++j)
{
struct group_statistics *gs;
- gs=&cmd->v_variables[i]->p.t_t.gs[j];
+ gs=&cmd->v_variables[i]->p.grp_data.gs[j];
gs->mean = gs->sum / gs->n;
#define val_h 1
#include <float.h>
+#include "config.h"
/* Values. */
#include <stddef.h>
#include "format.h"
-#include "t-test.h"
-#include "oneway.h"
+#include "group_proc.h"
#include "val.h"
/* Frequency tables. */
struct means_proc mns;
struct matrix_data_proc mxd;
struct match_files_proc mtf;
- struct t_test_proc t_t;
- struct oneway_proc ww;
+ struct group_proc grp_data;
}
p;
};