msgstr ""
"Project-Id-Version: PSPP 0.3.1\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2004-10-30 17:37+0800\n"
+"POT-Creation-Date: 2004-11-01 11:56+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"
#: src/sysfile-info.c:529 src/vfm.c:875 src/crosstabs.q:1068
#: src/crosstabs.q:1095 src/crosstabs.q:1115 src/crosstabs.q:1137
-#: src/frequencies.q:1068 src/frequencies.q:1186
+#: src/frequencies.q:1058 src/frequencies.q:1176
msgid "Value"
msgstr ""
msgid "Cases"
msgstr ""
-#: src/crosstabs.q:772 src/frequencies.q:1066 src/frequencies.q:1433
+#: src/crosstabs.q:772 src/frequencies.q:1056 src/frequencies.q:1423
msgid "Valid"
msgstr ""
-#: src/crosstabs.q:773 src/frequencies.q:1133 src/frequencies.q:1434
+#: src/crosstabs.q:773 src/frequencies.q:1123 src/frequencies.q:1424
msgid "Missing"
msgstr ""
#: src/crosstabs.q:774 src/crosstabs.q:977 src/crosstabs.q:1690
-#: src/frequencies.q:1142 src/oneway.q:287 src/oneway.q:464
+#: src/frequencies.q:1132 src/oneway.q:287 src/oneway.q:464
msgid "Total"
msgstr ""
-#: src/crosstabs.q:784 src/frequencies.q:1432 src/oneway.q:374
+#: src/crosstabs.q:784 src/frequencies.q:1422 src/oneway.q:374
#: src/t-test.q:680 src/t-test.q:703 src/t-test.q:828 src/t-test.q:1365
msgid "N"
msgstr ""
-#: src/crosstabs.q:785 src/frequencies.q:1070 src/frequencies.q:1071
-#: src/frequencies.q:1072
+#: src/crosstabs.q:785 src/frequencies.q:1060 src/frequencies.q:1061
+#: src/frequencies.q:1062
msgid "Percent"
msgstr ""
msgid "S.E. Skew"
msgstr ""
-#: src/frequencies.q:289
+#: src/frequencies.q:306
msgid ""
"At most one of BARCHART, HISTOGRAM, or HBAR should be given. HBAR will be "
"assumed. Argument values will be given precedence increasing along the "
"order given."
msgstr ""
-#: src/frequencies.q:372
+#: src/frequencies.q:389
#, c-format
msgid ""
"MAX must be greater than or equal to MIN, if both are specified. However, "
"MIN was specified as %g and MAX as %g. MIN and MAX will be ignored."
msgstr ""
-#: src/frequencies.q:696
+#: src/frequencies.q:713
msgid ""
"Upper limit of integer mode value range must be greater than lower limit."
msgstr ""
-#: src/frequencies.q:708
+#: src/frequencies.q:725
#, c-format
msgid "Variable %s specified multiple times on VARIABLES subcommand."
msgstr ""
-#: src/frequencies.q:721
+#: src/frequencies.q:738
#, c-format
msgid "Integer mode specified, but %s is not a numeric variable."
msgstr ""
-#: src/frequencies.q:783
+#: src/frequencies.q:800
msgid "`)' expected after GROUPED interval list."
msgstr ""
-#: src/frequencies.q:796
+#: src/frequencies.q:813
#, c-format
msgid "Variables %s specified on GROUPED but not on VARIABLES."
msgstr ""
-#: src/frequencies.q:799
+#: src/frequencies.q:816
#, c-format
msgid "Variables %s specified multiple times on GROUPED subcommand."
msgstr ""
-#: src/frequencies.q:855
-msgid "Percentile list expected after PERCENTILES."
-msgstr ""
-
-#: src/frequencies.q:863
-#, fuzzy
-msgid "Percentiles must be between 0 and 100."
-msgstr "Frame colour must be between 0 and 6."
-
-#: src/frequencies.q:1067 src/frequencies.q:1158 src/frequencies.q:1159
-#: src/frequencies.q:1189
+#: src/frequencies.q:1057 src/frequencies.q:1148 src/frequencies.q:1149
+#: src/frequencies.q:1179
msgid "Cum"
msgstr ""
-#: src/frequencies.q:1069
+#: src/frequencies.q:1059
msgid "Frequency"
msgstr ""
-#: src/frequencies.q:1088
+#: src/frequencies.q:1078
msgid "Value Label"
msgstr ""
-#: src/frequencies.q:1187
+#: src/frequencies.q:1177
msgid "Freq"
msgstr ""
-#: src/frequencies.q:1188 src/frequencies.q:1190
+#: src/frequencies.q:1178 src/frequencies.q:1180
msgid "Pct"
msgstr ""
-#: src/frequencies.q:1406
+#: src/frequencies.q:1396
#, c-format
msgid "No valid data for variable %s; statistics not displayed."
msgstr ""
-#: src/frequencies.q:1445
+#: src/frequencies.q:1435
msgid "Percentiles"
msgstr ""
#, c-format
msgid "%s & %s"
msgstr ""
+
+#, fuzzy
+#~ msgid "Percentiles must be between 0 and 100."
+#~ msgstr "Frame colour must be between 0 and 6."
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: pspp-dev@gnu.org\n"
-"POT-Creation-Date: 2004-10-30 17:37+0800\n"
+"POT-Creation-Date: 2004-11-01 11:56+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"
#: src/sysfile-info.c:529 src/vfm.c:875 src/crosstabs.q:1068
#: src/crosstabs.q:1095 src/crosstabs.q:1115 src/crosstabs.q:1137
-#: src/frequencies.q:1068 src/frequencies.q:1186
+#: src/frequencies.q:1058 src/frequencies.q:1176
msgid "Value"
msgstr ""
msgid "Cases"
msgstr ""
-#: src/crosstabs.q:772 src/frequencies.q:1066 src/frequencies.q:1433
+#: src/crosstabs.q:772 src/frequencies.q:1056 src/frequencies.q:1423
msgid "Valid"
msgstr ""
-#: src/crosstabs.q:773 src/frequencies.q:1133 src/frequencies.q:1434
+#: src/crosstabs.q:773 src/frequencies.q:1123 src/frequencies.q:1424
msgid "Missing"
msgstr ""
#: src/crosstabs.q:774 src/crosstabs.q:977 src/crosstabs.q:1690
-#: src/frequencies.q:1142 src/oneway.q:287 src/oneway.q:464
+#: src/frequencies.q:1132 src/oneway.q:287 src/oneway.q:464
msgid "Total"
msgstr ""
-#: src/crosstabs.q:784 src/frequencies.q:1432 src/oneway.q:374
+#: src/crosstabs.q:784 src/frequencies.q:1422 src/oneway.q:374
#: src/t-test.q:680 src/t-test.q:703 src/t-test.q:828 src/t-test.q:1365
msgid "N"
msgstr ""
-#: src/crosstabs.q:785 src/frequencies.q:1070 src/frequencies.q:1071
-#: src/frequencies.q:1072
+#: src/crosstabs.q:785 src/frequencies.q:1060 src/frequencies.q:1061
+#: src/frequencies.q:1062
msgid "Percent"
msgstr ""
msgid "S.E. Skew"
msgstr ""
-#: src/frequencies.q:289
+#: src/frequencies.q:306
msgid ""
"At most one of BARCHART, HISTOGRAM, or HBAR should be given. HBAR will be "
"assumed. Argument values will be given precedence increasing along the "
"order given."
msgstr ""
-#: src/frequencies.q:372
+#: src/frequencies.q:389
#, c-format
msgid ""
"MAX must be greater than or equal to MIN, if both are specified. However, "
"MIN was specified as %g and MAX as %g. MIN and MAX will be ignored."
msgstr ""
-#: src/frequencies.q:696
+#: src/frequencies.q:713
msgid ""
"Upper limit of integer mode value range must be greater than lower limit."
msgstr ""
-#: src/frequencies.q:708
+#: src/frequencies.q:725
#, c-format
msgid "Variable %s specified multiple times on VARIABLES subcommand."
msgstr ""
-#: src/frequencies.q:721
+#: src/frequencies.q:738
#, c-format
msgid "Integer mode specified, but %s is not a numeric variable."
msgstr ""
-#: src/frequencies.q:783
+#: src/frequencies.q:800
msgid "`)' expected after GROUPED interval list."
msgstr ""
-#: src/frequencies.q:796
+#: src/frequencies.q:813
#, c-format
msgid "Variables %s specified on GROUPED but not on VARIABLES."
msgstr ""
-#: src/frequencies.q:799
+#: src/frequencies.q:816
#, c-format
msgid "Variables %s specified multiple times on GROUPED subcommand."
msgstr ""
-#: src/frequencies.q:855
-msgid "Percentile list expected after PERCENTILES."
-msgstr ""
-
-#: src/frequencies.q:863
-msgid "Percentiles must be between 0 and 100."
-msgstr ""
-
-#: src/frequencies.q:1067 src/frequencies.q:1158 src/frequencies.q:1159
-#: src/frequencies.q:1189
+#: src/frequencies.q:1057 src/frequencies.q:1148 src/frequencies.q:1149
+#: src/frequencies.q:1179
msgid "Cum"
msgstr ""
-#: src/frequencies.q:1069
+#: src/frequencies.q:1059
msgid "Frequency"
msgstr ""
-#: src/frequencies.q:1088
+#: src/frequencies.q:1078
msgid "Value Label"
msgstr ""
-#: src/frequencies.q:1187
+#: src/frequencies.q:1177
msgid "Freq"
msgstr ""
-#: src/frequencies.q:1188 src/frequencies.q:1190
+#: src/frequencies.q:1178 src/frequencies.q:1180
msgid "Pct"
msgstr ""
-#: src/frequencies.q:1406
+#: src/frequencies.q:1396
#, c-format
msgid "No valid data for variable %s; statistics not displayed."
msgstr ""
-#: src/frequencies.q:1445
+#: src/frequencies.q:1435
msgid "Percentiles"
msgstr ""
+Mon Nov 1 12:46:17 WST 2004 John Darrington <john@darrington.wattle.id.au>
+
+ * q2c.c frequencies.q set.q t-test.q Fixed the q2c parsing of DBL
+ subcommand types. Changed frequencies.q to use it rather then the
+ custom parser. Dealt with the consequences. Added a test for NTILES
+ subcommand of frequencies.
+
Sat Oct 30 09:16:29 WST 2004 John Darrington <john@darrington.wattle.id.au>
* oneway.q Fixed up the behaviour when given missing values
norm:!nonormal/normal,
incr:increment(d:inc,"%s>0");
grouped=custom;
- ntiles=custom;
- percentiles=custom;
+ ntiles=integer;
+ +percentiles = double list;
statistics[st_]=1|mean,2|semean,3|median,4|mode,5|stddev,6|variance,
7|kurtosis,8|skewness,9|range,10|minimum,11|maximum,12|sum,
13|default,14|seskewness,15|sekurtosis,all,none.
int flag2; /* Set to 1 if this percentile value has been found */
};
+
+static void add_percentile (double x) ;
+
+
static struct percentile *percentiles;
static int n_percentiles;
if (chart != GFT_NONE || cmd.sbc_ntiles)
cmd.sort = FRQ_AVALUE;
+ /* Work out what percentiles need to be calculated */
+ if ( cmd.sbc_percentiles )
+ {
+ for ( i = 0 ; i < MAXLISTS ; ++i )
+ {
+ int pl;
+ subc_list_double *ptl_list = &cmd.dl_percentiles[i];
+ for ( pl = 0 ; pl < subc_list_double_count(ptl_list); ++pl)
+ add_percentile(subc_list_double_at(ptl_list,pl) / 100.0 );
+ }
+ }
+ if ( cmd.sbc_ntiles )
+ {
+ for ( i = 0 ; i < cmd.sbc_ntiles ; ++i )
+ {
+ int j;
+ for (j = 0; j <= cmd.n_ntiles[i]; ++j )
+ add_percentile(j / (double) cmd.n_ntiles[i]);
+ }
+ }
+
+
/* Do it! */
procedure_with_splits (precalc, calc, postcalc, NULL);
int i;
for (i = 0; i < n_percentiles; i++)
- if (x <= percentiles[i].p)
- break;
+ {
+ /* Do nothing if it's already in the list */
+ if ( fabs(x - percentiles[i].p) < DBL_EPSILON )
+ return;
+
+ if (x < percentiles[i].p)
+ break;
+ }
if (i >= n_percentiles || tokval != percentiles[i].p)
{
}
}
-/* Parses the PERCENTILES subcommand, adding user-specified
- percentiles to the list. */
-static int
-frq_custom_percentiles (struct cmd_frequencies *cmd UNUSED)
-{
- lex_match ('=');
- if (token != T_NUM)
- {
- msg (SE, _("Percentile list expected after PERCENTILES."));
- return 0;
- }
-
- do
- {
- if (tokval < 0 || tokval > 100)
- {
- msg (SE, _("Percentiles must be between 0 and 100."));
- return 0;
- }
-
- add_percentile (tokval / 100.0);
- lex_get ();
- lex_match (',');
- }
- while (token == T_NUM);
- return 1;
-}
-
-/* Parses the NTILES subcommand, adding the percentiles that
- correspond to the specified evenly-distributed ntiles. */
-static int
-frq_custom_ntiles (struct cmd_frequencies *cmd UNUSED)
-{
- int i;
-
- lex_match ('=');
- if (!lex_force_int ())
- return 0;
- for (i = 1; i < lex_integer (); i++)
- add_percentile (1.0 / lex_integer () * i);
- lex_get ();
- return 1;
-}
-\f
/* Comparison functions. */
/* Hash of numeric values. */
case SBC_INT:
case SBC_PINT:
- dump (0, "long n_%s;", st_lower (sbc->name));
+ dump (0, "long n_%s[MAXLISTS];", st_lower (sbc->name));
break;
case SBC_DBL:
- dump (0, "double n_%s;", st_lower (sbc->name));
+ dump (0, "double n_%s[MAXLISTS];", st_lower (sbc->name));
break;
case SBC_DBL_LIST:
break;
case SBC_DBL_LIST:
- dump (0, "int i;");
- dump (0, "for (i = 0; i < MAXLISTS; ++i)");
dump (1, "{");
+ dump (0, "int i;");
+ dump (1, "for (i = 0; i < MAXLISTS; ++i)");
dump (0, "subc_list_double_create(&p->dl_%s[i]) ;",
st_lower (sbc->name)
);
- dump (-1, "}");
+ dump (-2, "}");
break;
case SBC_DBL:
+ dump (1, "{");
+ dump (0, "int i;");
+ dump (1, "for (i = 0; i < MAXLISTS; ++i)");
+ dump (0, "p->n_%s[i] = SYSMIS;", st_lower (sbc->name));
+ dump (-2, "}");
+ break;
+
case SBC_CUSTOM:
/* nothing */
break;
case SBC_INT:
case SBC_PINT:
- dump (0, "p->n_%s = NOT_LONG;", st_lower (sbc->name));
+ dump (1, "{");
+ dump (0, "int i;");
+ dump (1, "for (i = 0; i < MAXLISTS; ++i)");
+ dump (0, "p->n_%s[i] = NOT_LONG;", st_lower (sbc->name));
+ dump (-2, "}");
break;
default:
{
dump (1, "if (!lex_force_num ())");
dump (0, "goto lossage;");
- dump (-1, "p->n_%s = lex_double ();", st_lower (sbc->name));
+ dump (-1, "p->n_%s[p->sbc_%s - 1] = lex_double ();",
+ st_lower (sbc->name), st_lower (sbc->name) );
dump (0, "lex_get();");
}
else if (sbc->type == SBC_INT)
dump (0, "goto lossage;");
dump (-1, "}");
}
- dump (-1, "p->n_%s = x;", st_lower (sbc->name));
+ dump (0, "p->n_%s[p->sbc_%s - 1] = x;", st_lower (sbc->name), st_lower(sbc->name) );
dump (-1,"}");
}
else if (sbc->type == SBC_PINT)
}
else if (sbc->type == SBC_INT)
{
- dump (0, "msg(MM,\"%s is %%ld\",p->n_%s);", sbc->name,st_lower(sbc->name) );
+ dump (1, "{");
+ dump (0, "int i;");
+ dump (1, "for (i = 0; i < MAXLISTS; ++i)");
+ dump (0, "msg(MM,\"%s is %%ld\",p->n_%s[i]);", sbc->name,st_lower(sbc->name) );
+ outdent();
+ dump (-1, "}");
}
else if (sbc->type == SBC_CUSTOM)
{
continue;
}
- dump (0, "#line %d \"%s\"", oln - 1, ofn);
+ dump (0, "#line %d \"%s\"", oln + 1, ofn);
if (!strcmp (directive, "specification"))
{
/* Skip leading slash-star line. */
cmd.safe = STC_OFF;
cmd.dec = STC_DOT;
- cmd.n_cpi = 6;
- cmd.n_lpi = 10;
+ cmd.n_cpi[0] = 6;
+ cmd.n_lpi[0] = 10;
cmd.echo = STC_OFF;
cmd.more = STC_ON;
cmd.headers = STC_YES;
set_journal = xstrdup ("pspp.jnl");
set_journaling = 1;
- cmd.n_mxwarns = 100;
- cmd.n_mxerrs = 100;
- cmd.n_mxloops = 1;
- cmd.n_workspace = 4L * 1024 * 1024;
+ cmd.n_mxwarns[0] = 100;
+ cmd.n_mxerrs[0] = 100;
+ cmd.n_mxloops[0] = 1;
+ cmd.n_workspace[0] = 4L * 1024 * 1024;
#if !USE_INTERNAL_PAGER
int
get_mxwarns(void)
{
- return cmd.n_mxwarns;
+ return cmd.n_mxwarns[0];
}
int
get_mxerrs(void)
{
- return cmd.n_mxerrs;
+ return cmd.n_mxerrs[0];
}
int
int
get_mxloops(void)
{
- return cmd.n_mxloops;
+ return cmd.n_mxloops[0];
}
int
size_t
get_max_workspace(void)
{
- return cmd.n_workspace;
+ return cmd.n_workspace[0];
}
double
/* (specification)
"T-TEST" (tts_):
+groups=custom;
- +testval=double;
+ testval=double;
variables=varlist("PV_NO_SCRATCH | PV_NUMERIC");
pairs=custom;
+missing=miss:!analysis/listwise,
tab_vline(self->t, TAL_2, 1, 0, vsize - 1);
tab_joint_text(self->t, 1, 0, hsize-1,0, TAB_CENTER | TAT_PRINTF,
- _("Test Value = %f"),cmd->n_testval);
+ _("Test Value = %f"), cmd->n_testval[0]);
tab_box(self->t, -1, -1, -1, TAL_1, 1,1,hsize-1,vsize-1);
tab_text (trb->t, 0, i+3, TAB_LEFT, cmd->v_variables[i]->name);
- t = (gs->mean - cmd->n_testval ) * sqrt(gs->n) / gs->std_dev ;
+ t = (gs->mean - cmd->n_testval[0] ) * sqrt(gs->n) / gs->std_dev ;
tab_float (trb->t, 1, i+3, TAB_RIGHT, t, 8,3);
gs= &cmd->v_variables[i]->p.grp_data.ugs;
if ( ! value_is_missing(val,v))
- gs->sum_diff += weight * (val->f - cmd->n_testval);
+ gs->sum_diff += weight * (val->f - cmd->n_testval[0]);
}
return 0;
stats/descript-mean-bug.sh \
stats/moments.sh \
stats/percentiles-compatible.sh \
+ stats/ntiles.sh \
stats/percentiles-enhanced.sh
noinst_PROGRAMS = gengarbage
--- /dev/null
+#! /bin/sh
+
+# Tests the NTILE subcommand of the frequencies command
+
+TEMPDIR=/tmp/pspp-tst-$$
+
+here=`pwd`;
+
+# ensure that top_srcdir is absolute
+cd $top_srcdir; top_srcdir=`pwd`
+
+export STAT_CONFIG_PATH=$top_srcdir/config
+
+
+cleanup()
+{
+ rm -rf $TEMPDIR
+ :
+}
+
+
+fail()
+{
+ echo $activity
+ echo FAILED
+ cleanup;
+ exit 1;
+}
+
+
+no_result()
+{
+ echo $activity
+ echo NO RESULT;
+ cleanup;
+ exit 2;
+}
+
+pass()
+{
+ cleanup;
+ exit 0;
+}
+
+mkdir -p $TEMPDIR
+
+cd $TEMPDIR
+
+
+i=1;
+
+activity="create program $i"
+cat > $TEMPDIR/prog.sps <<EOF
+DATA LIST LIST notable /x * .
+BEGIN DATA.
+1
+2
+3
+4
+5
+END DATA.
+
+FREQUENCIES
+ VAR=x
+ /PERCENTILES = 0 25 33.333 50 66.666 75 100
+
+EOF
+if [ $? -ne 0 ] ; then no_result; fi
+
+activity="run program $i"
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="move output"
+cp $TEMPDIR/pspp.list $TEMPDIR/list.ref
+if [ $? -ne 0 ] ; then no_result ; fi
+
+i=$[$i+1];
+
+activity="create program $i"
+cat > $TEMPDIR/prog.sps <<EOF
+DATA LIST LIST notable /x * .
+BEGIN DATA.
+1
+2
+3
+4
+5
+END DATA.
+
+FREQUENCIES
+ VAR=x
+ /NTILES = 3
+ /NTILES = 4
+ .
+EOF
+if [ $? -ne 0 ] ; then no_result; fi
+
+activity="run program $i"
+$SUPERVISOR $here/../src/pspp -o raw-ascii $TEMPDIR/prog.sps
+if [ $? -ne 0 ] ; then no_result ; fi
+
+activity="compare output"
+diff $TEMPDIR/pspp.list $TEMPDIR/list.ref
+if [ $? -ne 0 ] ; then fail; fi
+
+
+pass;