From 6429e116f1cacfe4be0ec6aae341cd712ca58463 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Thu, 12 Feb 2004 12:24:59 +0000 Subject: [PATCH] Added caculations for the grouped T-TEST --- po/en_GB.po | 348 ++++++++++++++++++++++++------------------------ po/pspp.pot | 348 ++++++++++++++++++++++++------------------------ src/ChangeLog | 7 + src/Makefile.am | 21 +-- src/expr-prs.c | 1 + src/t-test.h | 52 ++++++++ src/t-test.q | 280 ++++++++++++++++++++++++++++++++++++-- src/var.h | 31 +---- 8 files changed, 690 insertions(+), 398 deletions(-) create mode 100644 src/t-test.h diff --git a/po/en_GB.po b/po/en_GB.po index 4566f684..7b409412 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.3.1\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2004-02-07 14:00+0800\n" +"POT-Creation-Date: 2004-02-12 19:27+0800\n" "PO-Revision-Date: 2004-01-23 13:04+0800\n" "Last-Translator: John Darrington \n" "Language-Team: John Darrington \n" @@ -59,8 +59,8 @@ msgstr "" msgid "Total" msgstr "" -#: src/crosstabs.q:879 src/t-test.q:517 src/t-test.q:540 src/t-test.q:605 -#: src/t-test.q:991 +#: src/crosstabs.q:879 src/t-test.q:623 src/t-test.q:646 src/t-test.q:726 +#: src/t-test.q:1297 msgid "N" msgstr "" @@ -112,7 +112,7 @@ msgstr "" msgid "Value" msgstr "" -#: src/crosstabs.q:1161 src/t-test.q:748 src/t-test.q:822 src/t-test.q:876 +#: src/crosstabs.q:1161 src/t-test.q:879 src/t-test.q:1067 src/t-test.q:1181 msgid "df" msgstr "" @@ -149,11 +149,11 @@ msgstr "" msgid " 95%% Confidence Interval" msgstr "" -#: src/crosstabs.q:1208 src/t-test.q:752 src/t-test.q:819 src/t-test.q:879 +#: src/crosstabs.q:1208 src/t-test.q:883 src/t-test.q:1064 src/t-test.q:1184 msgid "Lower" msgstr "" -#: src/crosstabs.q:1209 src/t-test.q:753 src/t-test.q:820 src/t-test.q:880 +#: src/crosstabs.q:1209 src/t-test.q:884 src/t-test.q:1065 src/t-test.q:1185 msgid "Upper" msgstr "" @@ -290,8 +290,8 @@ msgstr "" msgid "%s Dependent" msgstr "" -#: src/descript.q:152 src/frequencies.q:94 src/t-test.q:518 src/t-test.q:541 -#: src/t-test.q:604 src/t-test.q:816 +#: src/descript.q:152 src/frequencies.q:94 src/t-test.q:624 src/t-test.q:647 +#: src/t-test.q:725 src/t-test.q:1061 msgid "Mean" msgstr "" @@ -506,7 +506,7 @@ msgstr "" msgid "Z-score of " msgstr "" -#: src/descript.q:792 src/data-list.c:732 src/data-list.c:869 src/print.c:805 +#: src/descript.q:792 src/data-list.c:732 src/data-list.c:869 src/print.c:801 #: src/sysfile-info.c:135 src/sysfile-info.c:370 src/vfm.c:1093 msgid "Variable" msgstr "" @@ -534,7 +534,7 @@ msgstr "" #: src/file-handle.q:88 src/autorecode.c:121 src/command.c:696 #: src/compute.c:284 src/data-list.c:372 src/data-list.c:842 #: src/data-list.c:1645 src/do-if.c:264 src/get.c:359 src/lexer.c:387 -#: src/loop.c:248 src/matrix-data.c:506 src/print.c:340 src/print.c:1081 +#: src/loop.c:248 src/matrix-data.c:506 src/print.c:336 src/print.c:1064 #: src/recode.c:409 src/sel-if.c:56 src/sel-if.c:136 src/vector.c:197 msgid "expecting end of command" msgstr "" @@ -857,150 +857,152 @@ msgstr "Frame colour must be between 0 and 6." msgid "Drive letter expected in WORKDEV subcommand." msgstr "" -#: src/t-test.q:169 -msgid "Exactly one of TESTVAL, GROUPS or PAIRS subcommands is required" +#: src/t-test.q:218 +msgid "TESTVAL, GROUPS and PAIRS subcommands are mutually exclusive." msgstr "" -#: src/t-test.q:183 +#: src/t-test.q:235 msgid "VARIABLES subcommand is not appropriate with PAIRS" msgstr "" -#: src/t-test.q:223 src/t-test.q:294 +#: src/t-test.q:325 src/t-test.q:397 #, c-format msgid "`%s' is not a variable name" msgstr "" -#: src/t-test.q:236 +#: src/t-test.q:338 #, c-format msgid "Long string variable %s is not valid here." msgstr "" -#: src/t-test.q:252 +#: src/t-test.q:354 msgid "" "When applying GROUPS to a string variable, at least one value must be " "specified." msgstr "" -#: src/t-test.q:329 +#: src/t-test.q:432 #, 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:346 +#: src/t-test.q:449 msgid "At least two variables must be specified on PAIRS." msgstr "" -#: src/t-test.q:515 +#: src/t-test.q:621 msgid "One-Sample Statistics" msgstr "" -#: src/t-test.q:519 src/t-test.q:542 src/t-test.q:606 src/t-test.q:817 +#: src/t-test.q:625 src/t-test.q:648 src/t-test.q:727 src/t-test.q:1062 msgid "Std. Deviation" msgstr "" -#: src/t-test.q:520 src/t-test.q:543 src/t-test.q:607 +#: src/t-test.q:626 src/t-test.q:649 src/t-test.q:728 msgid "SE. Mean" msgstr "" -#: src/t-test.q:537 +#: src/t-test.q:643 msgid "Group Statistics" msgstr "" -#: src/t-test.q:601 +#: src/t-test.q:722 msgid "Paired Sample Statistics" msgstr "" -#: src/t-test.q:625 src/t-test.q:839 src/t-test.q:1004 +#: src/t-test.q:744 src/t-test.q:1096 src/t-test.q:1318 #, c-format msgid "Pair %d" msgstr "" -#: src/t-test.q:733 +#: src/t-test.q:864 msgid "Independent Samples Test" msgstr "" -#: src/t-test.q:741 -msgid "Levine's Test for Equality of Variances" +#: src/t-test.q:872 +msgid "Levene's Test for Equality of Variances" msgstr "" -#: src/t-test.q:743 +#: src/t-test.q:874 msgid "t-test for Equality of Means" msgstr "" -#: src/t-test.q:745 +#: src/t-test.q:876 msgid "F" msgstr "" -#: src/t-test.q:746 src/t-test.q:993 +#: src/t-test.q:877 src/t-test.q:1299 msgid "Sig." msgstr "" -#: src/t-test.q:747 src/t-test.q:821 src/t-test.q:875 +#: src/t-test.q:878 src/t-test.q:1066 src/t-test.q:1180 msgid "t" msgstr "" -#: src/t-test.q:749 src/t-test.q:823 src/t-test.q:877 +#: src/t-test.q:880 src/t-test.q:1068 src/t-test.q:1182 msgid "Sig. (2-tailed)" msgstr "" -#: src/t-test.q:750 src/t-test.q:878 +#: src/t-test.q:881 src/t-test.q:1183 msgid "Mean Difference" msgstr "" -#: src/t-test.q:751 +#: src/t-test.q:882 msgid "Std. Error Difference" msgstr "" -#: src/t-test.q:757 src/t-test.q:809 src/t-test.q:869 +#: src/t-test.q:887 src/t-test.q:1058 src/t-test.q:1175 #, c-format msgid "%d%% Confidence Interval of the Difference" msgstr "" -#: src/t-test.q:777 +#: src/t-test.q:922 msgid "Equal variances assumed" msgstr "" -#: src/t-test.q:780 +#: src/t-test.q:942 src/t-test.q:962 src/t-test.q:1000 src/t-test.q:1012 +#: src/t-test.q:1117 src/t-test.q:1143 src/t-test.q:1225 src/t-test.q:1242 +#: src/t-test.q:1333 +#, c-format +msgid "Error calculating T statistic (cdft returned %d)." +msgstr "" + +#: src/t-test.q:976 msgid "Equal variances not assumed" msgstr "" -#: src/t-test.q:798 +#: src/t-test.q:1048 msgid "Paired Samples Test" msgstr "" -#: src/t-test.q:801 +#: src/t-test.q:1051 msgid "Paired Differences" msgstr "" -#: src/t-test.q:818 +#: src/t-test.q:1063 msgid "Std. Error Mean" msgstr "" -#: src/t-test.q:860 +#: src/t-test.q:1164 msgid "One-Sample Test" msgstr "" -#: src/t-test.q:864 +#: src/t-test.q:1169 #, c-format msgid "Test Value = %f" msgstr "" -#: src/t-test.q:920 src/t-test.q:936 -#, c-format -msgid "Error calculating T statistic (cdft returned %d)." -msgstr "" - -#: src/t-test.q:988 +#: src/t-test.q:1294 msgid "Paired Samples Correlations" msgstr "" -#: src/t-test.q:992 +#: src/t-test.q:1298 msgid "Correlation" msgstr "" -#: src/t-test.q:1008 +#: src/t-test.q:1321 #, c-format msgid "%s & %s" msgstr "" @@ -1043,7 +1045,7 @@ msgstr "" msgid "Arguments to %s must be of same type as source variables." msgstr "" -#: src/aggregate.c:578 src/expr-prs.c:664 +#: src/aggregate.c:578 src/expr-prs.c:665 msgid "expecting `)'" msgstr "" @@ -1066,16 +1068,16 @@ msgstr "" msgid "Variable %s is %s in target file, but %s in source file." msgstr "" -#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1127 -#: src/expr-prs.c:1472 src/expr-prs.c:1488 src/formats.c:103 -#: src/pfm-read.c:636 src/print.c:700 src/sfm-read.c:916 src/sfm-read.c:1042 +#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1128 +#: src/expr-prs.c:1473 src/expr-prs.c:1489 src/formats.c:103 +#: src/pfm-read.c:636 src/print.c:696 src/sfm-read.c:916 src/sfm-read.c:1042 #: src/sfm-read.c:1043 msgid "string" msgstr "" -#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1127 -#: src/expr-prs.c:1469 src/expr-prs.c:1486 src/formats.c:103 -#: src/pfm-read.c:636 src/print.c:700 src/sfm-read.c:916 src/sfm-read.c:1042 +#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1128 +#: src/expr-prs.c:1470 src/expr-prs.c:1487 src/formats.c:103 +#: src/pfm-read.c:636 src/print.c:696 src/sfm-read.c:916 src/sfm-read.c:1042 #: src/sfm-read.c:1043 msgid "numeric" msgstr "" @@ -1608,7 +1610,7 @@ msgstr "" msgid "Only one of FIXED, FREE, or LIST may be specified." msgstr "" -#: src/data-list.c:321 src/print.c:301 +#: src/data-list.c:321 src/print.c:297 #, c-format msgid "" "The record number specified, %ld, is before the previous record, %d. Data " @@ -1620,13 +1622,13 @@ msgid "" "SPSS-like or FORTRAN-like format specification expected after variable names." msgstr "" -#: src/data-list.c:364 src/print.c:333 +#: src/data-list.c:364 src/print.c:329 msgid "" "Variables are specified on records that should not exist according to " "RECORDS subcommand." msgstr "" -#: src/data-list.c:396 src/data-list.c:409 src/print.c:510 src/print.c:523 +#: src/data-list.c:396 src/data-list.c:409 src/print.c:506 src/print.c:519 msgid "Column positions for fields must be positive." msgstr "" @@ -1634,20 +1636,20 @@ msgstr "" msgid "The ending column for a field must be greater than the starting column." msgstr "" -#: src/data-list.c:438 src/print.c:551 +#: src/data-list.c:438 src/print.c:547 msgid "A format specifier on this line has extra characters on the end." msgstr "" -#: src/data-list.c:453 src/print.c:567 +#: src/data-list.c:453 src/print.c:563 msgid "The value for number of decimal places must be at least 1." msgstr "" -#: src/data-list.c:467 src/print.c:580 +#: src/data-list.c:467 src/print.c:576 #, c-format msgid "Input format %s doesn't accept decimal places." msgstr "" -#: src/data-list.c:488 src/print.c:600 +#: src/data-list.c:488 src/print.c:596 #, c-format msgid "The %d columns %d-%d can't be evenly divided into %d fields." msgstr "" @@ -1667,27 +1669,27 @@ msgstr "" msgid "There is already a string variable %s of a different width." msgstr "" -#: src/data-list.c:614 src/print.c:689 +#: src/data-list.c:614 src/print.c:685 msgid "" "The number of format specifications exceeds the number of variable names " "given." msgstr "" -#: src/data-list.c:698 src/print.c:773 +#: src/data-list.c:698 src/print.c:769 msgid "" "There aren't enough format specifications to match the number of variable " "names given." msgstr "" -#: src/data-list.c:733 src/print.c:806 +#: src/data-list.c:733 src/print.c:802 msgid "Record" msgstr "" -#: src/data-list.c:734 src/print.c:807 +#: src/data-list.c:734 src/print.c:803 msgid "Columns" msgstr "" -#: src/data-list.c:735 src/data-list.c:870 src/print.c:808 +#: src/data-list.c:735 src/data-list.c:870 src/print.c:804 msgid "Format" msgstr "" @@ -2064,7 +2066,7 @@ msgstr "" msgid "fatal" msgstr "" -#: src/error.c:255 src/error.c:262 src/error.c:265 src/expr-prs.c:1463 +#: src/error.c:255 src/error.c:262 src/error.c:265 src/expr-prs.c:1464 msgid "error" msgstr "" @@ -2080,260 +2082,260 @@ msgstr "" msgid "installation error" msgstr "" -#: src/expr-evl.c:1164 +#: src/expr-evl.c:1125 msgid "" "A number being treated as a Boolean in an expression was found to have a " "value other than 0 (false), 1 (true), or the system-missing value. The " "result was forced to 0." msgstr "" -#: src/expr-evl.c:1208 +#: src/expr-evl.c:1169 #, c-format msgid "" "SYSMIS is not a valid index value for vector %s. The result will be set to " "SYSMIS." msgstr "" -#: src/expr-evl.c:1212 +#: src/expr-evl.c:1173 #, c-format msgid "" "%g is not a valid index value for vector %s. The result will be set to " "SYSMIS." msgstr "" -#: src/expr-evl.c:1230 +#: src/expr-evl.c:1191 #, c-format msgid "" "SYSMIS is not a valid index value for vector %s. The result will be set to " "the empty string." msgstr "" -#: src/expr-evl.c:1235 +#: src/expr-evl.c:1196 #, c-format msgid "" "%g is not a valid index value for vector %s. The result will be set to the " "empty string." msgstr "" -#: src/expr-evl.c:1340 +#: src/expr-evl.c:1296 #, c-format msgid "evaluate_expression(): not implemented: %s\n" msgstr "" -#: src/expr-evl.c:1343 +#: src/expr-evl.c:1299 #, c-format msgid "evaluate_expression(): not implemented: %d\n" msgstr "" -#: src/expr-opt.c:662 +#: src/expr-opt.c:663 msgid "" "While optimizing a constant expression, there was a bad value for the third " "argument to INDEX." msgstr "" -#: src/expr-opt.c:687 +#: src/expr-opt.c:688 msgid "" "While optimizing a constant expression, there was a bad value for the third " "argument to RINDEX." msgstr "" -#: src/expr-opt.c:746 +#: src/expr-opt.c:747 #, c-format msgid "Third argument to %cPAD() must be at least one character in length." msgstr "" -#: src/expr-opt.c:779 +#: src/expr-opt.c:780 #, c-format msgid "Second argument to %cTRIM() must be at least one character in length." msgstr "" -#: src/expr-opt.c:880 +#: src/expr-opt.c:881 msgid "" "When optimizing a constant expression, an integer that was being used as an " "Boolean value was found to have a constant value other than 0, 1, or SYSMIS." msgstr "" -#: src/expr-prs.c:140 +#: src/expr-prs.c:141 msgid "" "A string expression was supplied in a place where a Boolean expression was " "expected." msgstr "" -#: src/expr-prs.c:151 +#: src/expr-prs.c:152 msgid "" "A numeric expression was expected in a place where one was not supplied." msgstr "" -#: src/expr-prs.c:159 +#: src/expr-prs.c:160 msgid "A string expression was expected in a place where one was not supplied." msgstr "" -#: src/expr-prs.c:173 +#: src/expr-prs.c:174 msgid "The OR operator cannot take string operands." msgstr "" -#: src/expr-prs.c:221 +#: src/expr-prs.c:222 msgid "The AND operator cannot take string operands." msgstr "" -#: src/expr-prs.c:270 +#: src/expr-prs.c:271 msgid "The NOT operator cannot take a string operand." msgstr "" -#: src/expr-prs.c:297 +#: src/expr-prs.c:298 msgid "" "Strings cannot be compared with numeric or Boolean values with the " "relational operators = >= > <= < <>." msgstr "" -#: src/expr-prs.c:354 +#: src/expr-prs.c:355 msgid "The `+' and `-' operators may only be used with numeric operands." msgstr "" -#: src/expr-prs.c:406 +#: src/expr-prs.c:407 msgid "The `*' and `/' operators may only be used with numeric operands." msgstr "" -#: src/expr-prs.c:457 +#: src/expr-prs.c:458 msgid "The unary minus (-) operator can only take a numeric operand." msgstr "" -#: src/expr-prs.c:487 +#: src/expr-prs.c:488 msgid "Both operands to the ** operator must be numeric." msgstr "" -#: src/expr-prs.c:581 +#: src/expr-prs.c:582 msgid "Use of $LENGTH is obsolete, returning default of 66." msgstr "" -#: src/expr-prs.c:586 +#: src/expr-prs.c:587 msgid "Use of $WIDTH is obsolete, returning default of 131." msgstr "" -#: src/expr-prs.c:591 +#: src/expr-prs.c:592 #, c-format msgid "Unknown system variable %s." msgstr "" -#: src/expr-prs.c:630 +#: src/expr-prs.c:631 msgid "expecting variable name" msgstr "" -#: src/expr-prs.c:672 +#: src/expr-prs.c:673 msgid "in expression" msgstr "" -#: src/expr-prs.c:853 +#: src/expr-prs.c:854 msgid "Argument 2 to LAG must be a small positive integer constant." msgstr "" -#: src/expr-prs.c:926 src/expr-prs.c:965 +#: src/expr-prs.c:927 src/expr-prs.c:966 #, c-format msgid "" "Type mismatch in argument %d of %s, which was expected to be of %s type. It " "was actually of %s type. " msgstr "" -#: src/expr-prs.c:952 +#: src/expr-prs.c:953 #, c-format msgid "%s cannot take Boolean operands." msgstr "" -#: src/expr-prs.c:984 +#: src/expr-prs.c:985 msgid "in function call" msgstr "" -#: src/expr-prs.c:998 +#: src/expr-prs.c:999 msgid "RANGE requires an odd number of arguments, but at least three." msgstr "" -#: src/expr-prs.c:1008 +#: src/expr-prs.c:1009 #, c-format msgid "%s requires at least two arguments." msgstr "" -#: src/expr-prs.c:1023 +#: src/expr-prs.c:1024 #, c-format msgid "%s.%d requires at least %d arguments." msgstr "" -#: src/expr-prs.c:1065 +#: src/expr-prs.c:1066 #, c-format msgid "" "Argument %d to CONCAT is type %s. All arguments to CONCAT must be strings." msgstr "" -#: src/expr-prs.c:1124 +#: src/expr-prs.c:1125 #, c-format msgid "" "Argument %d to %s was expected to be of %s type. It was actually of type %s." msgstr "" -#: src/expr-prs.c:1143 +#: src/expr-prs.c:1144 #, c-format msgid "%s is not a numeric format." msgstr "" -#: src/expr-prs.c:1169 +#: src/expr-prs.c:1170 #, c-format msgid "Too few arguments to function %s." msgstr "" -#: src/expr-prs.c:1201 +#: src/expr-prs.c:1202 #, c-format msgid "" "Type mismatch in argument %d of %s, which was expected to be numeric. It " "was actually type %s." msgstr "" -#: src/expr-prs.c:1210 +#: src/expr-prs.c:1211 #, c-format msgid "Missing comma following argument %d of %s." msgstr "" -#: src/expr-prs.c:1248 +#: src/expr-prs.c:1249 msgid "The index value after a vector name must be numeric." msgstr "" -#: src/expr-prs.c:1255 +#: src/expr-prs.c:1256 msgid "`)' expected after a vector index value." msgstr "" -#: src/expr-prs.c:1288 +#: src/expr-prs.c:1289 #, c-format msgid "There is no function named %s." msgstr "" -#: src/expr-prs.c:1293 +#: src/expr-prs.c:1294 #, c-format msgid "Function %s may not be given a minimum number of arguments." msgstr "" -#: src/expr-prs.c:1302 +#: src/expr-prs.c:1303 #, c-format msgid "expecting `)' after %s function" msgstr "" -#: src/expr-prs.c:1466 +#: src/expr-prs.c:1467 msgid "Boolean" msgstr "" -#: src/expr-prs.c:1695 +#: src/expr-prs.c:1696 #, c-format msgid "!!TERMINAL!!" msgstr "" -#: src/expr-prs.c:1721 +#: src/expr-prs.c:1722 #, c-format msgid "!!SENTINEL!!" msgstr "" -#: src/expr-prs.c:1724 +#: src/expr-prs.c:1725 #, c-format msgid "!!ERROR%d!!" msgstr "" -#: src/expr-prs.c:1742 +#: src/expr-prs.c:1743 msgid "postfix:" msgstr "" @@ -2494,54 +2496,54 @@ msgstr "" msgid "Not opening pipe file `%s' because SAFER option set." msgstr "" -#: src/flip.c:160 +#: src/flip.c:162 #, c-format msgid "Could not create acceptable variant for variable %s." msgstr "" -#: src/flip.c:177 +#: src/flip.c:179 msgid "Cannot create more than 99999 variable names." msgstr "" -#: src/flip.c:293 +#: src/flip.c:295 #, c-format msgid "Error reading FLIP source file: %s." msgstr "" -#: src/flip.c:369 +#: src/flip.c:382 msgid "Could not create temporary file for FLIP." msgstr "" -#: src/flip.c:379 src/flip.c:398 +#: src/flip.c:392 src/flip.c:411 #, c-format msgid "Error writing FLIP file: %s." msgstr "" -#: src/flip.c:434 +#: src/flip.c:447 msgid "Error creating FLIP source file." msgstr "" -#: src/flip.c:437 +#: src/flip.c:450 #, c-format msgid "Error rewinding FLIP file: %s." msgstr "" -#: src/flip.c:446 +#: src/flip.c:459 #, c-format msgid "Error reading FLIP file: %s." msgstr "" -#: src/flip.c:458 +#: src/flip.c:471 #, c-format msgid "Error seeking FLIP source file: %s." msgstr "" -#: src/flip.c:463 +#: src/flip.c:476 #, c-format msgid "Error writing FLIP source file: %s." msgstr "" -#: src/flip.c:471 +#: src/flip.c:484 #, c-format msgid "Error rewind FLIP source file: %s." msgstr "" @@ -3094,7 +3096,7 @@ msgstr "" msgid "The rest of this command has been discarded." msgstr "" -#: src/lexer.c:842 src/print.c:1174 +#: src/lexer.c:842 src/print.c:1157 #, c-format msgid "" msgstr "" @@ -3761,11 +3763,11 @@ msgstr "" msgid "%s variable %s has %s format specifier %s." msgstr "" -#: src/pfm-read.c:634 src/print.c:612 src/sfm-read.c:914 +#: src/pfm-read.c:634 src/print.c:608 src/sfm-read.c:914 msgid "String" msgstr "" -#: src/pfm-read.c:634 src/print.c:612 src/sfm-read.c:914 +#: src/pfm-read.c:634 src/print.c:608 src/sfm-read.c:914 msgid "Numeric" msgstr "" @@ -4031,64 +4033,64 @@ msgstr "" msgid "PostScript driver: Cannot find encoding `%s' for PostScript font `%s'." msgstr "" -#: src/print.c:190 +#: src/print.c:186 msgid "expecting a valid subcommand" msgstr "" -#: src/print.c:370 src/print.c:387 +#: src/print.c:366 src/print.c:383 #, c-format msgid "%g is not a valid column location." msgstr "" -#: src/print.c:381 +#: src/print.c:377 #, c-format msgid "Column location expected following `%d-'." msgstr "" -#: src/print.c:392 +#: src/print.c:388 #, c-format msgid "" "%d-%ld is not a valid column range. The second column must be greater than " "or equal to the first." msgstr "" -#: src/print.c:498 +#: src/print.c:494 #, c-format msgid "" "%s is not of the same type as %s. To specify variables of different types " "in the same variable list, use a FORTRAN-like format specifier." msgstr "" -#: src/print.c:528 +#: src/print.c:524 msgid "" "The ending column for a field must not be less than the starting column." msgstr "" -#: src/print.c:611 +#: src/print.c:607 #, c-format msgid "%s variables cannot be displayed with format %s." msgstr "" -#: src/print.c:698 +#: src/print.c:694 #, c-format msgid "Display format %s may not be used with a %s variable." msgstr "" -#: src/print.c:848 +#: src/print.c:844 #, c-format msgid "Writing %3d records to file %s." msgstr "" -#: src/print.c:849 +#: src/print.c:845 #, c-format msgid "Writing %3d records to the listing file." msgstr "" -#: src/print.c:1063 +#: src/print.c:1046 msgid "A file name or handle was expected in the OUTFILE subcommand." msgstr "" -#: src/print.c:1115 +#: src/print.c:1098 #, c-format msgid "" "The expression on PRINT SPACE evaluated to %d. It's not possible to PRINT " @@ -4662,128 +4664,128 @@ msgstr "" msgid "`)' expected." msgstr "" -#: src/sort.c:452 +#: src/sort.c:456 #, c-format msgid "%s: Cannot create temporary directory: %s." msgstr "" -#: src/sort.c:476 +#: src/sort.c:480 #, c-format msgid "%s: Error removing directory for temporary files: %s." msgstr "" -#: src/sort.c:522 +#: src/sort.c:526 #, c-format msgid "" "Out of memory. Could not allocate room for minimum of %d cases of %d bytes " "each. (PSPP workspace is currently restricted to a maximum of %d KB.)" msgstr "" -#: src/sort.c:534 +#: src/sort.c:538 #, c-format msgid "allocated %d cases == %d bytes\n" msgstr "" -#: src/sort.c:572 +#: src/sort.c:576 #, c-format msgid "%s: Error writing temporary file: %s." msgstr "" -#: src/sort.c:584 +#: src/sort.c:588 #, c-format msgid "SORT: Closing handle %d." msgstr "" -#: src/sort.c:590 src/sort.c:815 +#: src/sort.c:594 src/sort.c:819 #, c-format msgid "%s: Error closing temporary file: %s." msgstr "" -#: src/sort.c:612 src/sort.c:628 +#: src/sort.c:616 src/sort.c:632 #, c-format msgid "SORT: %s: Opening for writing as run %d." msgstr "" -#: src/sort.c:634 +#: src/sort.c:638 #, c-format msgid "%s: Error opening temporary file for reading: %s." msgstr "" -#: src/sort.c:660 src/sort.c:676 +#: src/sort.c:664 src/sort.c:680 #, c-format msgid "%s: Error creating temporary file: %s." msgstr "" -#: src/sort.c:819 src/sort.c:981 src/sort.c:1031 src/sort.c:1203 -#: src/sort.c:1210 +#: src/sort.c:823 src/sort.c:985 src/sort.c:1035 src/sort.c:1207 +#: src/sort.c:1214 #, c-format msgid "%s: Error removing temporary file: %s." msgstr "" -#: src/sort.c:963 +#: src/sort.c:967 msgid "merging runs" msgstr "" -#: src/sort.c:971 +#: src/sort.c:975 #, c-format msgid " into run %d(%d)\n" msgstr "" -#: src/sort.c:990 +#: src/sort.c:994 msgid "Out of memory expanding Huffman priority queue." msgstr "" -#: src/sort.c:1042 +#: src/sort.c:1046 #, c-format msgid "%s: Error creating temporary file for merge: %s." msgstr "" -#: src/sort.c:1070 src/sort.c:1130 +#: src/sort.c:1074 src/sort.c:1134 #, c-format msgid "%s: Error reading temporary file in merge: %s." msgstr "" -#: src/sort.c:1073 src/sort.c:1134 +#: src/sort.c:1077 src/sort.c:1138 #, c-format msgid "%s: Unexpected end of temporary file in merge." msgstr "" -#: src/sort.c:1099 +#: src/sort.c:1103 #, c-format msgid "%s: Error writing temporary file in merge: %s." msgstr "" -#: src/sort.c:1150 src/sort.c:1183 +#: src/sort.c:1154 src/sort.c:1187 #, c-format msgid "%s: Error closing temporary file in merge: %s." msgstr "" -#: src/sort.c:1155 +#: src/sort.c:1159 #, c-format msgid "%s: Error removing temporary file in merge: %s." msgstr "" -#: src/sort.c:1254 +#: src/sort.c:1258 #, c-format msgid "%s: Cannot open sort result file: %s." msgstr "" -#: src/sort.c:1265 +#: src/sort.c:1269 #, c-format msgid "%s: Error reading sort result file: %s." msgstr "" -#: src/sort.c:1268 +#: src/sort.c:1272 #, c-format msgid "%s: Unexpected end of sort result file: %s." msgstr "" -#: src/sort.c:1279 +#: src/sort.c:1283 #, c-format msgid "%s: Error closing sort result file: %s." msgstr "" -#: src/sort.c:1283 +#: src/sort.c:1287 #, c-format msgid "%s: Error removing sort result file: %s." msgstr "" diff --git a/po/pspp.pot b/po/pspp.pot index 6f7f7a9f..0808c05d 100644 --- a/po/pspp.pot +++ b/po/pspp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2004-02-07 14:00+0800\n" +"POT-Creation-Date: 2004-02-12 19:27+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -60,8 +60,8 @@ msgstr "" msgid "Total" msgstr "" -#: src/crosstabs.q:879 src/t-test.q:517 src/t-test.q:540 src/t-test.q:605 -#: src/t-test.q:991 +#: src/crosstabs.q:879 src/t-test.q:623 src/t-test.q:646 src/t-test.q:726 +#: src/t-test.q:1297 msgid "N" msgstr "" @@ -113,7 +113,7 @@ msgstr "" msgid "Value" msgstr "" -#: src/crosstabs.q:1161 src/t-test.q:748 src/t-test.q:822 src/t-test.q:876 +#: src/crosstabs.q:1161 src/t-test.q:879 src/t-test.q:1067 src/t-test.q:1181 msgid "df" msgstr "" @@ -150,11 +150,11 @@ msgstr "" msgid " 95%% Confidence Interval" msgstr "" -#: src/crosstabs.q:1208 src/t-test.q:752 src/t-test.q:819 src/t-test.q:879 +#: src/crosstabs.q:1208 src/t-test.q:883 src/t-test.q:1064 src/t-test.q:1184 msgid "Lower" msgstr "" -#: src/crosstabs.q:1209 src/t-test.q:753 src/t-test.q:820 src/t-test.q:880 +#: src/crosstabs.q:1209 src/t-test.q:884 src/t-test.q:1065 src/t-test.q:1185 msgid "Upper" msgstr "" @@ -291,8 +291,8 @@ msgstr "" msgid "%s Dependent" msgstr "" -#: src/descript.q:152 src/frequencies.q:94 src/t-test.q:518 src/t-test.q:541 -#: src/t-test.q:604 src/t-test.q:816 +#: src/descript.q:152 src/frequencies.q:94 src/t-test.q:624 src/t-test.q:647 +#: src/t-test.q:725 src/t-test.q:1061 msgid "Mean" msgstr "" @@ -507,7 +507,7 @@ msgstr "" msgid "Z-score of " msgstr "" -#: src/descript.q:792 src/data-list.c:732 src/data-list.c:869 src/print.c:805 +#: src/descript.q:792 src/data-list.c:732 src/data-list.c:869 src/print.c:801 #: src/sysfile-info.c:135 src/sysfile-info.c:370 src/vfm.c:1093 msgid "Variable" msgstr "" @@ -535,7 +535,7 @@ msgstr "" #: src/file-handle.q:88 src/autorecode.c:121 src/command.c:696 #: src/compute.c:284 src/data-list.c:372 src/data-list.c:842 #: src/data-list.c:1645 src/do-if.c:264 src/get.c:359 src/lexer.c:387 -#: src/loop.c:248 src/matrix-data.c:506 src/print.c:340 src/print.c:1081 +#: src/loop.c:248 src/matrix-data.c:506 src/print.c:336 src/print.c:1064 #: src/recode.c:409 src/sel-if.c:56 src/sel-if.c:136 src/vector.c:197 msgid "expecting end of command" msgstr "" @@ -858,150 +858,152 @@ msgstr "" msgid "Drive letter expected in WORKDEV subcommand." msgstr "" -#: src/t-test.q:169 -msgid "Exactly one of TESTVAL, GROUPS or PAIRS subcommands is required" +#: src/t-test.q:218 +msgid "TESTVAL, GROUPS and PAIRS subcommands are mutually exclusive." msgstr "" -#: src/t-test.q:183 +#: src/t-test.q:235 msgid "VARIABLES subcommand is not appropriate with PAIRS" msgstr "" -#: src/t-test.q:223 src/t-test.q:294 +#: src/t-test.q:325 src/t-test.q:397 #, c-format msgid "`%s' is not a variable name" msgstr "" -#: src/t-test.q:236 +#: src/t-test.q:338 #, c-format msgid "Long string variable %s is not valid here." msgstr "" -#: src/t-test.q:252 +#: src/t-test.q:354 msgid "" "When applying GROUPS to a string variable, at least one value must be " "specified." msgstr "" -#: src/t-test.q:329 +#: src/t-test.q:432 #, 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:346 +#: src/t-test.q:449 msgid "At least two variables must be specified on PAIRS." msgstr "" -#: src/t-test.q:515 +#: src/t-test.q:621 msgid "One-Sample Statistics" msgstr "" -#: src/t-test.q:519 src/t-test.q:542 src/t-test.q:606 src/t-test.q:817 +#: src/t-test.q:625 src/t-test.q:648 src/t-test.q:727 src/t-test.q:1062 msgid "Std. Deviation" msgstr "" -#: src/t-test.q:520 src/t-test.q:543 src/t-test.q:607 +#: src/t-test.q:626 src/t-test.q:649 src/t-test.q:728 msgid "SE. Mean" msgstr "" -#: src/t-test.q:537 +#: src/t-test.q:643 msgid "Group Statistics" msgstr "" -#: src/t-test.q:601 +#: src/t-test.q:722 msgid "Paired Sample Statistics" msgstr "" -#: src/t-test.q:625 src/t-test.q:839 src/t-test.q:1004 +#: src/t-test.q:744 src/t-test.q:1096 src/t-test.q:1318 #, c-format msgid "Pair %d" msgstr "" -#: src/t-test.q:733 +#: src/t-test.q:864 msgid "Independent Samples Test" msgstr "" -#: src/t-test.q:741 -msgid "Levine's Test for Equality of Variances" +#: src/t-test.q:872 +msgid "Levene's Test for Equality of Variances" msgstr "" -#: src/t-test.q:743 +#: src/t-test.q:874 msgid "t-test for Equality of Means" msgstr "" -#: src/t-test.q:745 +#: src/t-test.q:876 msgid "F" msgstr "" -#: src/t-test.q:746 src/t-test.q:993 +#: src/t-test.q:877 src/t-test.q:1299 msgid "Sig." msgstr "" -#: src/t-test.q:747 src/t-test.q:821 src/t-test.q:875 +#: src/t-test.q:878 src/t-test.q:1066 src/t-test.q:1180 msgid "t" msgstr "" -#: src/t-test.q:749 src/t-test.q:823 src/t-test.q:877 +#: src/t-test.q:880 src/t-test.q:1068 src/t-test.q:1182 msgid "Sig. (2-tailed)" msgstr "" -#: src/t-test.q:750 src/t-test.q:878 +#: src/t-test.q:881 src/t-test.q:1183 msgid "Mean Difference" msgstr "" -#: src/t-test.q:751 +#: src/t-test.q:882 msgid "Std. Error Difference" msgstr "" -#: src/t-test.q:757 src/t-test.q:809 src/t-test.q:869 +#: src/t-test.q:887 src/t-test.q:1058 src/t-test.q:1175 #, c-format msgid "%d%% Confidence Interval of the Difference" msgstr "" -#: src/t-test.q:777 +#: src/t-test.q:922 msgid "Equal variances assumed" msgstr "" -#: src/t-test.q:780 +#: src/t-test.q:942 src/t-test.q:962 src/t-test.q:1000 src/t-test.q:1012 +#: src/t-test.q:1117 src/t-test.q:1143 src/t-test.q:1225 src/t-test.q:1242 +#: src/t-test.q:1333 +#, c-format +msgid "Error calculating T statistic (cdft returned %d)." +msgstr "" + +#: src/t-test.q:976 msgid "Equal variances not assumed" msgstr "" -#: src/t-test.q:798 +#: src/t-test.q:1048 msgid "Paired Samples Test" msgstr "" -#: src/t-test.q:801 +#: src/t-test.q:1051 msgid "Paired Differences" msgstr "" -#: src/t-test.q:818 +#: src/t-test.q:1063 msgid "Std. Error Mean" msgstr "" -#: src/t-test.q:860 +#: src/t-test.q:1164 msgid "One-Sample Test" msgstr "" -#: src/t-test.q:864 +#: src/t-test.q:1169 #, c-format msgid "Test Value = %f" msgstr "" -#: src/t-test.q:920 src/t-test.q:936 -#, c-format -msgid "Error calculating T statistic (cdft returned %d)." -msgstr "" - -#: src/t-test.q:988 +#: src/t-test.q:1294 msgid "Paired Samples Correlations" msgstr "" -#: src/t-test.q:992 +#: src/t-test.q:1298 msgid "Correlation" msgstr "" -#: src/t-test.q:1008 +#: src/t-test.q:1321 #, c-format msgid "%s & %s" msgstr "" @@ -1044,7 +1046,7 @@ msgstr "" msgid "Arguments to %s must be of same type as source variables." msgstr "" -#: src/aggregate.c:578 src/expr-prs.c:664 +#: src/aggregate.c:578 src/expr-prs.c:665 msgid "expecting `)'" msgstr "" @@ -1067,16 +1069,16 @@ msgstr "" msgid "Variable %s is %s in target file, but %s in source file." msgstr "" -#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1127 -#: src/expr-prs.c:1472 src/expr-prs.c:1488 src/formats.c:103 -#: src/pfm-read.c:636 src/print.c:700 src/sfm-read.c:916 src/sfm-read.c:1042 +#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1128 +#: src/expr-prs.c:1473 src/expr-prs.c:1489 src/formats.c:103 +#: src/pfm-read.c:636 src/print.c:696 src/sfm-read.c:916 src/sfm-read.c:1042 #: src/sfm-read.c:1043 msgid "string" msgstr "" -#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1127 -#: src/expr-prs.c:1469 src/expr-prs.c:1486 src/formats.c:103 -#: src/pfm-read.c:636 src/print.c:700 src/sfm-read.c:916 src/sfm-read.c:1042 +#: src/apply-dict.c:71 src/apply-dict.c:72 src/expr-prs.c:1128 +#: src/expr-prs.c:1470 src/expr-prs.c:1487 src/formats.c:103 +#: src/pfm-read.c:636 src/print.c:696 src/sfm-read.c:916 src/sfm-read.c:1042 #: src/sfm-read.c:1043 msgid "numeric" msgstr "" @@ -1609,7 +1611,7 @@ msgstr "" msgid "Only one of FIXED, FREE, or LIST may be specified." msgstr "" -#: src/data-list.c:321 src/print.c:301 +#: src/data-list.c:321 src/print.c:297 #, c-format msgid "" "The record number specified, %ld, is before the previous record, %d. Data " @@ -1621,13 +1623,13 @@ msgid "" "SPSS-like or FORTRAN-like format specification expected after variable names." msgstr "" -#: src/data-list.c:364 src/print.c:333 +#: src/data-list.c:364 src/print.c:329 msgid "" "Variables are specified on records that should not exist according to " "RECORDS subcommand." msgstr "" -#: src/data-list.c:396 src/data-list.c:409 src/print.c:510 src/print.c:523 +#: src/data-list.c:396 src/data-list.c:409 src/print.c:506 src/print.c:519 msgid "Column positions for fields must be positive." msgstr "" @@ -1635,20 +1637,20 @@ msgstr "" msgid "The ending column for a field must be greater than the starting column." msgstr "" -#: src/data-list.c:438 src/print.c:551 +#: src/data-list.c:438 src/print.c:547 msgid "A format specifier on this line has extra characters on the end." msgstr "" -#: src/data-list.c:453 src/print.c:567 +#: src/data-list.c:453 src/print.c:563 msgid "The value for number of decimal places must be at least 1." msgstr "" -#: src/data-list.c:467 src/print.c:580 +#: src/data-list.c:467 src/print.c:576 #, c-format msgid "Input format %s doesn't accept decimal places." msgstr "" -#: src/data-list.c:488 src/print.c:600 +#: src/data-list.c:488 src/print.c:596 #, c-format msgid "The %d columns %d-%d can't be evenly divided into %d fields." msgstr "" @@ -1668,27 +1670,27 @@ msgstr "" msgid "There is already a string variable %s of a different width." msgstr "" -#: src/data-list.c:614 src/print.c:689 +#: src/data-list.c:614 src/print.c:685 msgid "" "The number of format specifications exceeds the number of variable names " "given." msgstr "" -#: src/data-list.c:698 src/print.c:773 +#: src/data-list.c:698 src/print.c:769 msgid "" "There aren't enough format specifications to match the number of variable " "names given." msgstr "" -#: src/data-list.c:733 src/print.c:806 +#: src/data-list.c:733 src/print.c:802 msgid "Record" msgstr "" -#: src/data-list.c:734 src/print.c:807 +#: src/data-list.c:734 src/print.c:803 msgid "Columns" msgstr "" -#: src/data-list.c:735 src/data-list.c:870 src/print.c:808 +#: src/data-list.c:735 src/data-list.c:870 src/print.c:804 msgid "Format" msgstr "" @@ -2065,7 +2067,7 @@ msgstr "" msgid "fatal" msgstr "" -#: src/error.c:255 src/error.c:262 src/error.c:265 src/expr-prs.c:1463 +#: src/error.c:255 src/error.c:262 src/error.c:265 src/expr-prs.c:1464 msgid "error" msgstr "" @@ -2081,260 +2083,260 @@ msgstr "" msgid "installation error" msgstr "" -#: src/expr-evl.c:1164 +#: src/expr-evl.c:1125 msgid "" "A number being treated as a Boolean in an expression was found to have a " "value other than 0 (false), 1 (true), or the system-missing value. The " "result was forced to 0." msgstr "" -#: src/expr-evl.c:1208 +#: src/expr-evl.c:1169 #, c-format msgid "" "SYSMIS is not a valid index value for vector %s. The result will be set to " "SYSMIS." msgstr "" -#: src/expr-evl.c:1212 +#: src/expr-evl.c:1173 #, c-format msgid "" "%g is not a valid index value for vector %s. The result will be set to " "SYSMIS." msgstr "" -#: src/expr-evl.c:1230 +#: src/expr-evl.c:1191 #, c-format msgid "" "SYSMIS is not a valid index value for vector %s. The result will be set to " "the empty string." msgstr "" -#: src/expr-evl.c:1235 +#: src/expr-evl.c:1196 #, c-format msgid "" "%g is not a valid index value for vector %s. The result will be set to the " "empty string." msgstr "" -#: src/expr-evl.c:1340 +#: src/expr-evl.c:1296 #, c-format msgid "evaluate_expression(): not implemented: %s\n" msgstr "" -#: src/expr-evl.c:1343 +#: src/expr-evl.c:1299 #, c-format msgid "evaluate_expression(): not implemented: %d\n" msgstr "" -#: src/expr-opt.c:662 +#: src/expr-opt.c:663 msgid "" "While optimizing a constant expression, there was a bad value for the third " "argument to INDEX." msgstr "" -#: src/expr-opt.c:687 +#: src/expr-opt.c:688 msgid "" "While optimizing a constant expression, there was a bad value for the third " "argument to RINDEX." msgstr "" -#: src/expr-opt.c:746 +#: src/expr-opt.c:747 #, c-format msgid "Third argument to %cPAD() must be at least one character in length." msgstr "" -#: src/expr-opt.c:779 +#: src/expr-opt.c:780 #, c-format msgid "Second argument to %cTRIM() must be at least one character in length." msgstr "" -#: src/expr-opt.c:880 +#: src/expr-opt.c:881 msgid "" "When optimizing a constant expression, an integer that was being used as an " "Boolean value was found to have a constant value other than 0, 1, or SYSMIS." msgstr "" -#: src/expr-prs.c:140 +#: src/expr-prs.c:141 msgid "" "A string expression was supplied in a place where a Boolean expression was " "expected." msgstr "" -#: src/expr-prs.c:151 +#: src/expr-prs.c:152 msgid "" "A numeric expression was expected in a place where one was not supplied." msgstr "" -#: src/expr-prs.c:159 +#: src/expr-prs.c:160 msgid "A string expression was expected in a place where one was not supplied." msgstr "" -#: src/expr-prs.c:173 +#: src/expr-prs.c:174 msgid "The OR operator cannot take string operands." msgstr "" -#: src/expr-prs.c:221 +#: src/expr-prs.c:222 msgid "The AND operator cannot take string operands." msgstr "" -#: src/expr-prs.c:270 +#: src/expr-prs.c:271 msgid "The NOT operator cannot take a string operand." msgstr "" -#: src/expr-prs.c:297 +#: src/expr-prs.c:298 msgid "" "Strings cannot be compared with numeric or Boolean values with the " "relational operators = >= > <= < <>." msgstr "" -#: src/expr-prs.c:354 +#: src/expr-prs.c:355 msgid "The `+' and `-' operators may only be used with numeric operands." msgstr "" -#: src/expr-prs.c:406 +#: src/expr-prs.c:407 msgid "The `*' and `/' operators may only be used with numeric operands." msgstr "" -#: src/expr-prs.c:457 +#: src/expr-prs.c:458 msgid "The unary minus (-) operator can only take a numeric operand." msgstr "" -#: src/expr-prs.c:487 +#: src/expr-prs.c:488 msgid "Both operands to the ** operator must be numeric." msgstr "" -#: src/expr-prs.c:581 +#: src/expr-prs.c:582 msgid "Use of $LENGTH is obsolete, returning default of 66." msgstr "" -#: src/expr-prs.c:586 +#: src/expr-prs.c:587 msgid "Use of $WIDTH is obsolete, returning default of 131." msgstr "" -#: src/expr-prs.c:591 +#: src/expr-prs.c:592 #, c-format msgid "Unknown system variable %s." msgstr "" -#: src/expr-prs.c:630 +#: src/expr-prs.c:631 msgid "expecting variable name" msgstr "" -#: src/expr-prs.c:672 +#: src/expr-prs.c:673 msgid "in expression" msgstr "" -#: src/expr-prs.c:853 +#: src/expr-prs.c:854 msgid "Argument 2 to LAG must be a small positive integer constant." msgstr "" -#: src/expr-prs.c:926 src/expr-prs.c:965 +#: src/expr-prs.c:927 src/expr-prs.c:966 #, c-format msgid "" "Type mismatch in argument %d of %s, which was expected to be of %s type. It " "was actually of %s type. " msgstr "" -#: src/expr-prs.c:952 +#: src/expr-prs.c:953 #, c-format msgid "%s cannot take Boolean operands." msgstr "" -#: src/expr-prs.c:984 +#: src/expr-prs.c:985 msgid "in function call" msgstr "" -#: src/expr-prs.c:998 +#: src/expr-prs.c:999 msgid "RANGE requires an odd number of arguments, but at least three." msgstr "" -#: src/expr-prs.c:1008 +#: src/expr-prs.c:1009 #, c-format msgid "%s requires at least two arguments." msgstr "" -#: src/expr-prs.c:1023 +#: src/expr-prs.c:1024 #, c-format msgid "%s.%d requires at least %d arguments." msgstr "" -#: src/expr-prs.c:1065 +#: src/expr-prs.c:1066 #, c-format msgid "" "Argument %d to CONCAT is type %s. All arguments to CONCAT must be strings." msgstr "" -#: src/expr-prs.c:1124 +#: src/expr-prs.c:1125 #, c-format msgid "" "Argument %d to %s was expected to be of %s type. It was actually of type %s." msgstr "" -#: src/expr-prs.c:1143 +#: src/expr-prs.c:1144 #, c-format msgid "%s is not a numeric format." msgstr "" -#: src/expr-prs.c:1169 +#: src/expr-prs.c:1170 #, c-format msgid "Too few arguments to function %s." msgstr "" -#: src/expr-prs.c:1201 +#: src/expr-prs.c:1202 #, c-format msgid "" "Type mismatch in argument %d of %s, which was expected to be numeric. It " "was actually type %s." msgstr "" -#: src/expr-prs.c:1210 +#: src/expr-prs.c:1211 #, c-format msgid "Missing comma following argument %d of %s." msgstr "" -#: src/expr-prs.c:1248 +#: src/expr-prs.c:1249 msgid "The index value after a vector name must be numeric." msgstr "" -#: src/expr-prs.c:1255 +#: src/expr-prs.c:1256 msgid "`)' expected after a vector index value." msgstr "" -#: src/expr-prs.c:1288 +#: src/expr-prs.c:1289 #, c-format msgid "There is no function named %s." msgstr "" -#: src/expr-prs.c:1293 +#: src/expr-prs.c:1294 #, c-format msgid "Function %s may not be given a minimum number of arguments." msgstr "" -#: src/expr-prs.c:1302 +#: src/expr-prs.c:1303 #, c-format msgid "expecting `)' after %s function" msgstr "" -#: src/expr-prs.c:1466 +#: src/expr-prs.c:1467 msgid "Boolean" msgstr "" -#: src/expr-prs.c:1695 +#: src/expr-prs.c:1696 #, c-format msgid "!!TERMINAL!!" msgstr "" -#: src/expr-prs.c:1721 +#: src/expr-prs.c:1722 #, c-format msgid "!!SENTINEL!!" msgstr "" -#: src/expr-prs.c:1724 +#: src/expr-prs.c:1725 #, c-format msgid "!!ERROR%d!!" msgstr "" -#: src/expr-prs.c:1742 +#: src/expr-prs.c:1743 msgid "postfix:" msgstr "" @@ -2495,54 +2497,54 @@ msgstr "" msgid "Not opening pipe file `%s' because SAFER option set." msgstr "" -#: src/flip.c:160 +#: src/flip.c:162 #, c-format msgid "Could not create acceptable variant for variable %s." msgstr "" -#: src/flip.c:177 +#: src/flip.c:179 msgid "Cannot create more than 99999 variable names." msgstr "" -#: src/flip.c:293 +#: src/flip.c:295 #, c-format msgid "Error reading FLIP source file: %s." msgstr "" -#: src/flip.c:369 +#: src/flip.c:382 msgid "Could not create temporary file for FLIP." msgstr "" -#: src/flip.c:379 src/flip.c:398 +#: src/flip.c:392 src/flip.c:411 #, c-format msgid "Error writing FLIP file: %s." msgstr "" -#: src/flip.c:434 +#: src/flip.c:447 msgid "Error creating FLIP source file." msgstr "" -#: src/flip.c:437 +#: src/flip.c:450 #, c-format msgid "Error rewinding FLIP file: %s." msgstr "" -#: src/flip.c:446 +#: src/flip.c:459 #, c-format msgid "Error reading FLIP file: %s." msgstr "" -#: src/flip.c:458 +#: src/flip.c:471 #, c-format msgid "Error seeking FLIP source file: %s." msgstr "" -#: src/flip.c:463 +#: src/flip.c:476 #, c-format msgid "Error writing FLIP source file: %s." msgstr "" -#: src/flip.c:471 +#: src/flip.c:484 #, c-format msgid "Error rewind FLIP source file: %s." msgstr "" @@ -3095,7 +3097,7 @@ msgstr "" msgid "The rest of this command has been discarded." msgstr "" -#: src/lexer.c:842 src/print.c:1174 +#: src/lexer.c:842 src/print.c:1157 #, c-format msgid "" msgstr "" @@ -3762,11 +3764,11 @@ msgstr "" msgid "%s variable %s has %s format specifier %s." msgstr "" -#: src/pfm-read.c:634 src/print.c:612 src/sfm-read.c:914 +#: src/pfm-read.c:634 src/print.c:608 src/sfm-read.c:914 msgid "String" msgstr "" -#: src/pfm-read.c:634 src/print.c:612 src/sfm-read.c:914 +#: src/pfm-read.c:634 src/print.c:608 src/sfm-read.c:914 msgid "Numeric" msgstr "" @@ -4032,64 +4034,64 @@ msgstr "" msgid "PostScript driver: Cannot find encoding `%s' for PostScript font `%s'." msgstr "" -#: src/print.c:190 +#: src/print.c:186 msgid "expecting a valid subcommand" msgstr "" -#: src/print.c:370 src/print.c:387 +#: src/print.c:366 src/print.c:383 #, c-format msgid "%g is not a valid column location." msgstr "" -#: src/print.c:381 +#: src/print.c:377 #, c-format msgid "Column location expected following `%d-'." msgstr "" -#: src/print.c:392 +#: src/print.c:388 #, c-format msgid "" "%d-%ld is not a valid column range. The second column must be greater than " "or equal to the first." msgstr "" -#: src/print.c:498 +#: src/print.c:494 #, c-format msgid "" "%s is not of the same type as %s. To specify variables of different types " "in the same variable list, use a FORTRAN-like format specifier." msgstr "" -#: src/print.c:528 +#: src/print.c:524 msgid "" "The ending column for a field must not be less than the starting column." msgstr "" -#: src/print.c:611 +#: src/print.c:607 #, c-format msgid "%s variables cannot be displayed with format %s." msgstr "" -#: src/print.c:698 +#: src/print.c:694 #, c-format msgid "Display format %s may not be used with a %s variable." msgstr "" -#: src/print.c:848 +#: src/print.c:844 #, c-format msgid "Writing %3d records to file %s." msgstr "" -#: src/print.c:849 +#: src/print.c:845 #, c-format msgid "Writing %3d records to the listing file." msgstr "" -#: src/print.c:1063 +#: src/print.c:1046 msgid "A file name or handle was expected in the OUTFILE subcommand." msgstr "" -#: src/print.c:1115 +#: src/print.c:1098 #, c-format msgid "" "The expression on PRINT SPACE evaluated to %d. It's not possible to PRINT " @@ -4663,128 +4665,128 @@ msgstr "" msgid "`)' expected." msgstr "" -#: src/sort.c:452 +#: src/sort.c:456 #, c-format msgid "%s: Cannot create temporary directory: %s." msgstr "" -#: src/sort.c:476 +#: src/sort.c:480 #, c-format msgid "%s: Error removing directory for temporary files: %s." msgstr "" -#: src/sort.c:522 +#: src/sort.c:526 #, c-format msgid "" "Out of memory. Could not allocate room for minimum of %d cases of %d bytes " "each. (PSPP workspace is currently restricted to a maximum of %d KB.)" msgstr "" -#: src/sort.c:534 +#: src/sort.c:538 #, c-format msgid "allocated %d cases == %d bytes\n" msgstr "" -#: src/sort.c:572 +#: src/sort.c:576 #, c-format msgid "%s: Error writing temporary file: %s." msgstr "" -#: src/sort.c:584 +#: src/sort.c:588 #, c-format msgid "SORT: Closing handle %d." msgstr "" -#: src/sort.c:590 src/sort.c:815 +#: src/sort.c:594 src/sort.c:819 #, c-format msgid "%s: Error closing temporary file: %s." msgstr "" -#: src/sort.c:612 src/sort.c:628 +#: src/sort.c:616 src/sort.c:632 #, c-format msgid "SORT: %s: Opening for writing as run %d." msgstr "" -#: src/sort.c:634 +#: src/sort.c:638 #, c-format msgid "%s: Error opening temporary file for reading: %s." msgstr "" -#: src/sort.c:660 src/sort.c:676 +#: src/sort.c:664 src/sort.c:680 #, c-format msgid "%s: Error creating temporary file: %s." msgstr "" -#: src/sort.c:819 src/sort.c:981 src/sort.c:1031 src/sort.c:1203 -#: src/sort.c:1210 +#: src/sort.c:823 src/sort.c:985 src/sort.c:1035 src/sort.c:1207 +#: src/sort.c:1214 #, c-format msgid "%s: Error removing temporary file: %s." msgstr "" -#: src/sort.c:963 +#: src/sort.c:967 msgid "merging runs" msgstr "" -#: src/sort.c:971 +#: src/sort.c:975 #, c-format msgid " into run %d(%d)\n" msgstr "" -#: src/sort.c:990 +#: src/sort.c:994 msgid "Out of memory expanding Huffman priority queue." msgstr "" -#: src/sort.c:1042 +#: src/sort.c:1046 #, c-format msgid "%s: Error creating temporary file for merge: %s." msgstr "" -#: src/sort.c:1070 src/sort.c:1130 +#: src/sort.c:1074 src/sort.c:1134 #, c-format msgid "%s: Error reading temporary file in merge: %s." msgstr "" -#: src/sort.c:1073 src/sort.c:1134 +#: src/sort.c:1077 src/sort.c:1138 #, c-format msgid "%s: Unexpected end of temporary file in merge." msgstr "" -#: src/sort.c:1099 +#: src/sort.c:1103 #, c-format msgid "%s: Error writing temporary file in merge: %s." msgstr "" -#: src/sort.c:1150 src/sort.c:1183 +#: src/sort.c:1154 src/sort.c:1187 #, c-format msgid "%s: Error closing temporary file in merge: %s." msgstr "" -#: src/sort.c:1155 +#: src/sort.c:1159 #, c-format msgid "%s: Error removing temporary file in merge: %s." msgstr "" -#: src/sort.c:1254 +#: src/sort.c:1258 #, c-format msgid "%s: Cannot open sort result file: %s." msgstr "" -#: src/sort.c:1265 +#: src/sort.c:1269 #, c-format msgid "%s: Error reading sort result file: %s." msgstr "" -#: src/sort.c:1268 +#: src/sort.c:1272 #, c-format msgid "%s: Unexpected end of sort result file: %s." msgstr "" -#: src/sort.c:1279 +#: src/sort.c:1283 #, c-format msgid "%s: Error closing sort result file: %s." msgstr "" -#: src/sort.c:1283 +#: src/sort.c:1287 #, c-format msgid "%s: Error removing sort result file: %s." msgstr "" diff --git a/src/ChangeLog b/src/ChangeLog index 4f6deaec..d463a513 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +Thu Feb 12 19:24:53 WST 2004 John Darrington + + * t-test.q: Added calculations for independent samples. (But no Levene + test yet!) + + * Makefile.am: Moved q_sources_c into own variable + Wed Feb 11 23:56:51 2004 Ben Pfaff Miscellaneous cleanups. diff --git a/src/Makefile.am b/src/Makefile.am index 65381ace..144bc09f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -33,26 +33,27 @@ frequencies.c list.c means.c set.c t-test.c q_sources_q = correlations.q crosstabs.q descript.q file-handle.q \ frequencies.q list.q means.q set.q t-test.q -pspp_SOURCES = aggregate.c algorithm.c algorithm.h alloc.c alloc.h \ +pspp_SOURCES = $(q_sources_c) \ +aggregate.c algorithm.c algorithm.h alloc.c alloc.h \ apply-dict.c approx.h ascii.c autorecode.c bitvector.h cases.c cases.h \ cmdline.c cmdline.h command.c command.def command.h compute.c \ -correlations.c count.c crosstabs.c data-in.c data-in.h data-list.c \ -data-out.c debug-print.h descript.c devind.c devind.h dfm.c dfm.h \ +count.c data-in.c data-in.h data-list.c \ +data-out.c debug-print.h devind.c devind.h dfm.c dfm.h \ dictionary.c do-if.c do-ifP.h error.c error.h expr-evl.c expr-opt.c \ -expr-prs.c expr.h exprP.h file-handle.c file-handle.h file-type.c \ +expr-prs.c expr.h exprP.h file-handle.h file-type.c \ filename.c filename.h flip.c font.h format.c format.def format.h \ -formats.c frequencies.c get.c getline.c getline.h glob.c glob.h \ +formats.c get.c getline.c getline.h glob.c glob.h \ groff-font.c hash.c hash.h heap.c heap.h html.c htmlP.h include.c \ -inpt-pgm.c lexer.c lexer.h list.c log.h loop.c magic.c magic.h main.c \ -main.h matrix-data.c matrix.c matrix.h means.c mis-val.c misc.c misc.h \ +inpt-pgm.c lexer.c lexer.h log.h loop.c magic.c magic.h main.c \ +main.h matrix-data.c matrix.c matrix.h mis-val.c misc.c misc.h \ modify-vars.c 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 set.c settings.h \ +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 stat.h stats.c stats.h str.c str.h sysfile-info.c tab.c \ -tab.h temporary.c title.c t-test.c val-labs.c value-labels.c \ +tab.h temporary.c title.c t-test.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 +version.c version.h vfm.c vfm.h vfmP.h weight.c pspp_LDADD = ../lib/julcal/libjulcal.a \ ../lib/misc/libmisc.a \ diff --git a/src/expr-prs.c b/src/expr-prs.c index d8e20853..fee00a3e 100644 --- a/src/expr-prs.c +++ b/src/expr-prs.c @@ -32,6 +32,7 @@ #include "str.h" #include "var.h" #include "vfm.h" +#include "pool.h" /* Declarations. */ diff --git a/src/t-test.h b/src/t-test.h new file mode 100644 index 00000000..8a72fb9d --- /dev/null +++ b/src/t-test.h @@ -0,0 +1,52 @@ +/* PSPP - computes sample statistics. + Copyright (C) 2004 Free Software Foundation, Inc. + Written by John Darrington + + 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 + +/* T-TEST private data */ +struct t_test_proc + { + double mean; + + /* Population std. deviation */ + double std_dev; + + /* Sample std. deviation */ + double s_std_dev; + + /* count */ + double n; + + double sum; + + /* Sum of squares */ + double ssq; + + /* Std Err of Mean */ + double se_mean; + + /* Sum of differnces */ + double sum_diff; + + /* Mean of differences */ + double mean_diff ; + }; + +#endif diff --git a/src/t-test.q b/src/t-test.q index 1e3150fa..e673395b 100644 --- a/src/t-test.q +++ b/src/t-test.q @@ -39,6 +39,7 @@ #include "pool.h" #include "hash.h" #include "stats.h" +#include "t-test.h" /* (specification) "T-TEST" (tts_): @@ -56,6 +57,7 @@ static struct cmd_t_test cmd; +int value_compare(const union value *a, const union value *b, int width); static struct pool *t_test_pool ; @@ -68,6 +70,13 @@ static struct variable *groups; static int n_groups_values; static union value groups_values[2]; +/* Array of statistics for each group */ +typedef struct t_test_proc group_stats_t[2]; +static group_stats_t *groups_stats; + + + + /* PAIRS: Number of pairs to be compared ; each pair. */ static int n_pairs = 0 ; struct pair @@ -122,7 +131,7 @@ void ssbox_finalize(struct ssbox *ssb); /* A function to create, populate and submit the Paired Samples Correlation box */ -void pscbox(struct cmd_t_test *cmd); +void pscbox(void); /* Structures and Functions for the Test Results Box */ @@ -167,10 +176,16 @@ static int paired_calc (struct ccase *); static void paired_precalc (void); static void paired_postcalc (void); +static void group_precalc (void); +static int group_calc (struct ccase *); +static void group_postcalc (void); + + static int compare_var_name (const void *a_, const void *b_, void *v_ UNUSED); static unsigned hash_var_name (const void *a_, void *v_ UNUSED); + int cmd_t_test(void) { @@ -264,6 +279,10 @@ cmd_t_test(void) case T_PAIRED: procedure(paired_precalc,paired_calc,paired_postcalc); break; + case T_IND_SAMPLES: + procedure(group_precalc,group_calc,group_postcalc); + break; + } @@ -275,7 +294,7 @@ cmd_t_test(void) if ( mode == T_PAIRED) { - pscbox(&cmd); + pscbox(); } trbox_create(&test_results_box,&cmd,mode); @@ -656,6 +675,8 @@ ssbox_independent_samples_populate(struct ssbox *ssb, for (i=0; i < cmd->n_variables; ++i) { + int g; + tab_text (ssb->t, 0, i*2+1, TAB_LEFT, cmd->v_variables[i]->name); if (val_lab1) @@ -663,10 +684,23 @@ ssbox_independent_samples_populate(struct ssbox *ssb, else tab_float(ssb->t, 1 ,i*2+1, TAB_LEFT, groups_values[0].f, 2,0); + if (val_lab2) tab_text (ssb->t, 1, i*2+1+1, TAB_LEFT, val_lab2); else tab_float(ssb->t, 1 ,i*2+1+1, TAB_LEFT, groups_values[1].f,2,0); + + /* Fill in the group statistics */ + for ( g=0; g < 2 ; ++g ) + { + struct t_test_proc *ttp = &groups_stats[i][g]; + + tab_float(ssb->t, 2 ,i*2+g+1, TAB_RIGHT, ttp->n, 2, 0); + tab_float(ssb->t, 3 ,i*2+g+1, TAB_RIGHT, ttp->mean, 8, 2); + tab_float(ssb->t, 4 ,i*2+g+1, TAB_RIGHT, ttp->std_dev, 8, 3); + tab_float(ssb->t, 5 ,i*2+g+1, TAB_RIGHT, ttp->se_mean, 8, 3); + } + } } @@ -835,7 +869,7 @@ trbox_independent_samples_init(struct trbox *self, tab_hline(self->t,TAL_1, hsize-2,hsize-1,2); tab_box(self->t,-1,-1,-1,TAL_1, hsize-2,2,hsize-1,vsize-1); tab_joint_text(self->t, 2, 0, 3, 0, - TAB_CENTER,_("Levine's Test for Equality of Variances")); + TAB_CENTER,_("Levene's Test for Equality of Variances")); tab_joint_text(self->t, 4,0,hsize-1,0, TAB_CENTER,_("t-test for Equality of Means")); @@ -865,12 +899,137 @@ trbox_independent_samples_populate(struct trbox *self, assert(self); for (i=0; i < cmd->n_variables; ++i) { + int which =1; + double p,q; + int status; + double bound; + + double t; + double df; + + double pooled_variance; + double std_err_diff; + double mean_diff; + + struct t_test_proc *ttp0; + struct t_test_proc *ttp1; + ttp0=&groups_stats[i][0]; + ttp1=&groups_stats[i][1]; + + tab_text (self->t, 0, i*2+3, TAB_LEFT, cmd->v_variables[i]->name); tab_text (self->t, 1, i*2+3, TAB_LEFT, _("Equal variances assumed")); + df = ttp0->n + ttp1->n - 2.0 ; + tab_float (self->t, 5, i*2+3, TAB_RIGHT, df, 2, 0); + + pooled_variance = ( (ttp0->n )*sqr(ttp0->s_std_dev) + + + (ttp1->n )*sqr(ttp1->s_std_dev) + ) / df ; + + t = (ttp0->mean - ttp1->mean) / sqrt(pooled_variance) ; + t /= sqrt((ttp0->n + ttp1->n)/(ttp0->n*ttp1->n)); + + tab_float (self->t, 4, i*2+3, TAB_RIGHT, t, 8, 3); + + + which=1; /* get p & q from t & df */ + cdft(&which, &p, &q, &t, &df, &status, &bound); + if ( 0 != status ) + { + msg( SE, _("Error calculating T statistic (cdft returned %d)."),status); + } + + tab_float(self->t, 6, i*2+3, TAB_RIGHT, 2.0*(t>0?q:p) , 8, 3); + + mean_diff = ttp0->mean - ttp1->mean; + tab_float(self->t, 7, i*2+3, TAB_RIGHT, mean_diff, 8, 3); + + + std_err_diff = sqrt( sqr(ttp0->se_mean) + sqr(ttp1->se_mean)); + tab_float(self->t, 8, i*2+3, TAB_RIGHT, std_err_diff, 8, 3); + + + /* Now work out the confidence interval */ + q = (1 - cmd->criteria)/2.0; /* 2-tailed test */ + p = 1 - q ; + which=2; /* Calc T from p,q and df */ + cdft(&which, &p, &q, &t, &df, &status, &bound); + if ( 0 != status ) + { + msg( SE, _("Error calculating T statistic (cdft returned %d)."),status); + } + + tab_float(self->t, 9, i*2+3, TAB_RIGHT, + mean_diff - t * std_err_diff, 8, 3); + + tab_float(self->t, 10, i*2+3, TAB_RIGHT, + mean_diff + t * std_err_diff, 8, 3); + + + { + double se2; + /* Now for the \sigma_1 != \sigma_2 case */ tab_text (self->t, 1, i*2+3+1, TAB_LEFT, _("Equal variances not assumed")); + + + se2 = (sqr(ttp0->s_std_dev)/(ttp0->n -1) ) + + (sqr(ttp1->s_std_dev)/(ttp1->n -1) ); + + t = mean_diff / sqrt(se2) ; + tab_float (self->t, 4, i*2+3+1, TAB_RIGHT, t, 8, 3); + + df = sqr(se2) / ( + (sqr(sqr(ttp0->s_std_dev)/(ttp0->n - 1 )) + /(ttp0->n -1 ) + ) + + + (sqr(sqr(ttp1->s_std_dev)/(ttp1->n - 1 )) + /(ttp1->n -1 ) + ) + ) ; + tab_float (self->t, 5, i*2+3+1, TAB_RIGHT, df, 8, 3); + + which=1; /* get p & q from t & df */ + cdft(&which, &p, &q, &t, &df, &status, &bound); + if ( 0 != status ) + { + msg( SE, _("Error calculating T statistic (cdft returned %d)."),status); + } + + tab_float(self->t, 6, i*2+3+1, TAB_RIGHT, 2.0*(t>0?q:p) , 8, 3); + + /* Now work out the confidence interval */ + q = (1 - cmd->criteria)/2.0; /* 2-tailed test */ + p = 1 - q ; + which=2; /* Calc T from p,q and df */ + cdft(&which, &p, &q, &t, &df, &status, &bound); + if ( 0 != status ) + { + msg( SE, _("Error calculating T statistic (cdft returned %d)."),status); + } + + + tab_float(self->t, 7, i*2+3+1, TAB_RIGHT, mean_diff, 8, 3); + + + tab_float(self->t, 8, i*2+3+1, TAB_RIGHT, std_err_diff, 8, 3); + + + tab_float(self->t, 9, i*2+3+1, TAB_RIGHT, + mean_diff - t * std_err_diff, 8, 3); + + tab_float(self->t, 10, i*2+3+1, TAB_RIGHT, + mean_diff + t * std_err_diff, 8, 3); + + + + + } + } } @@ -985,7 +1144,7 @@ trbox_paired_populate(struct trbox *trb, } - tab_float(trb->t, 9, i+3, TAB_RIGHT, p*2.0 , 8, 3); + tab_float(trb->t, 9, i+3, TAB_RIGHT, 2.0*(t>0?q:p) , 8, 3); } @@ -1067,8 +1226,9 @@ trbox_one_sample_populate(struct trbox *trb, struct cmd_t_test *cmd) } - /* Multiply by 2 to get 2-tailed significance */ - tab_float (trb->t, 3, i+3, TAB_RIGHT, q*2.0, 8,3); + /* Multiply by 2 to get 2-tailed significance, makeing sure we've got + the correct tail*/ + tab_float (trb->t, 3, i+3, TAB_RIGHT, 2.0*(t>0?q:p), 8,3); tab_float (trb->t, 4, i+3, TAB_RIGHT, ttp->mean_diff, 8,3); @@ -1115,7 +1275,7 @@ trbox_base_finalize(struct trbox *trb) /* Create , populate and submit the Paired Samples Correlation box */ void -pscbox(struct cmd_t_test *cmd) +pscbox(void) { const int rows=1+n_pairs; const int cols=5; @@ -1138,7 +1298,6 @@ pscbox(struct cmd_t_test *cmd) tab_text(table, 3,0, TAB_CENTER | TAT_TITLE, _("Correlation")); tab_text(table, 4,0, TAB_CENTER | TAT_TITLE, _("Sig.")); - for (i=0; i < n_pairs; ++i) { int which =1; @@ -1175,10 +1334,7 @@ pscbox(struct cmd_t_test *cmd) } - tab_float(table, 4, i+1, TAB_RIGHT, q*2.0, 8, 3); - - - + tab_float(table, 4, i+1, TAB_RIGHT, 2.0*(correlation_t>0?q:p), 8, 3); } @@ -1398,3 +1554,103 @@ paired_postcalc (void) } } + + +/* Compare two (union value)s */ +int +value_compare(const union value *a, const union value *b, int width) +{ + if (width == 0) + return (a->f < b->f) ? -1 : ( a->f > b->f ) ; + else + return memcmp (a->s, b->s, width); +} + + +static int +get_group(const union value *val, struct variable *var) +{ + if ( 0 == value_compare(val,&groups_values[0],var->width) ) + return 0; + else if (0 == value_compare(val,&groups_values[1],var->width) ) + return 1; + + /* Never reached */ + assert(0); + return -1; +} + + +static void +group_precalc (void) +{ + int i; + int j; + + groups_stats = xmalloc(sizeof(group_stats_t) * cmd.n_variables); + + for(i=0; i< cmd.n_variables ; ++i) + { + for (j=0 ; j < 2 ; ++j) + { + groups_stats[i][j].sum=0; + groups_stats[i][j].n=0; + groups_stats[i][j].ssq=0; + } + } + +} + +static int +group_calc (struct ccase *c) +{ + int i; + union value *gv = &c->data[groups->fv]; + + double weight = dict_get_case_weight(default_dict,c); + + gv = &c->data[groups->fv]; + + for(i=0; i< cmd.n_variables ; ++i) + { + int g = get_group(gv,groups); + struct t_test_proc *ttp=&groups_stats[i][g]; + union value *val=&c->data[cmd.v_variables[i]->fv]; + + ttp->n+=weight; + ttp->sum+=weight * val->f; + ttp->ssq+=weight * sqr(val->f); + } + + return 0; +} + +static void +group_postcalc (void) +{ + int i; + int j; + + for(i=0; i< cmd.n_variables ; ++i) + { + for (j=0 ; j < 2 ; ++j) + { + struct t_test_proc *ttp; + ttp=&groups_stats[i][j]; + + ttp->mean = ttp->sum / ttp->n; + + ttp->s_std_dev= sqrt( + ( (ttp->ssq / ttp->n ) - ttp->mean * ttp->mean ) + ) ; + + ttp->std_dev= sqrt( + ttp->n/(ttp->n-1) * + ( (ttp->ssq / ttp->n ) - ttp->mean * ttp->mean ) + ) ; + + ttp->se_mean = ttp->std_dev / sqrt(ttp->n); + } + + } +} diff --git a/src/var.h b/src/var.h index a698045d..f67ef84d 100644 --- a/src/var.h +++ b/src/var.h @@ -22,6 +22,7 @@ #include #include "format.h" +#include "t-test.h" /* Values. */ @@ -129,36 +130,6 @@ struct crosstab_proc }; -/* T-TEST private data */ -struct t_test_proc - { - double mean; - - /* Population std. deviation */ - double std_dev; - - /* Sample std. deviation */ - double s_std_dev; - - /* count */ - double n; - - double sum; - - /* Sum of squares */ - double ssq; - - /* Std Err of Mean */ - double se_mean; - - /* Sum of differnces */ - double sum_diff; - - /* Mean of differences */ - double mean_diff ; - }; - - /* FREQUENCIES private data. */ enum { -- 2.30.2