/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
+ Written by John Williams <johnr.williams@stonebow.otago.ac.nz>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
#include "lexer.h"
#include "error.h"
#include "magic.h"
+#include "value-labels.h"
#include "var.h"
#include "vfm.h"
/* (declarations) */
/* (functions) */
-#undef DEBUGGING
-#define DEBUGGING 1
#include "debug-print.h"
/* Command parsing information. */
double X = c->data[v->fv].f;
/* Get the weight for this case. */
- if (default_dict.weight_index == -1)
- w = 1.0;
- else
+ w = dict_get_case_weight (default_dict, c);
+ if (w <= 0.0 || w == SYSMIS)
{
- w = c->data[default_dict.weight_index].f;
- if (w <= 0.0 || w == SYSMIS)
- {
- w = 0.0;
- bad_weight = 1;
- printf ("Bad weight\n");
- }
+ w = 0.0;
+ bad_weight = 1;
+ printf ("Bad weight\n");
}
if (X == SYSMIS || X == 0.0) /* FIXME: should be USER_MISSING? */
int /* this pass generates the z-zcores */
z_calc (struct ccase * c)
{
- int bad_weight;
double group, z, w;
struct variable *v = cmd.v_variables[cur_var];
double X = c->data[v->fv].f;
z = 0.0;
/* Get the weight for this case. */
- if (default_dict.weight_index == -1)
- w = 1.0;
- else
- {
- w = c->data[default_dict.weight_index].f;
- if (w <= 0.0 || w == SYSMIS)
- {
- w = 0.0;
- bad_weight = 1;
- }
- }
+ w = dict_get_case_weight (default_dict, c);
if (X == SYSMIS || X == 0.0) /* FIXME: how to specify user missing? */
{
int n_predicted;
#endif
- if ((token != T_ID || !is_varname (tokid)) && token != T_ALL)
+ if ((token != T_ID || dict_lookup_var (default_dict, tokid) == NULL)
+ && token != T_ALL)
return 2;
- if (!parse_variables (&default_dict, &vars, &n_vars,
+ if (!parse_variables (default_dict, &vars, &n_vars,
PV_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH))
return 0;
{
n_before_WITH = n_vars;
- if (!parse_variables (&default_dict, &vars, &n_vars,
+ if (!parse_variables (default_dict, &vars, &n_vars,
PV_DUPLICATE | PV_APPEND
| PV_NUMERIC | PV_NO_SCRATCH))
{
printf ("-----------------------------------------------------------\n");
printf (" %s %s\n\n", cmd.v_variables[cur_var]->name, cmd.v_variables[cur_var]->label);
printf ("%s %8.4f %8.0f %8.4f %8.3f %8.3f\n",
- get_val_lab (grps, *g1, 0), g1->f, n1, mean1, sd1, se1);
+ val_labs_find (grps->val_labs, *g1), g1->f, n1, mean1, sd1, se1);
printf ("%s %8.4f %8.0f %8.4f %8.3f %8.3f\n",
- get_val_lab (grps, *g2, 0), g2->f, n2, mean2, sd2, se2);
+ val_labs_find (grps->val_labs, *g2), g2->f, n2, mean2, sd2, se2);
printf ("-----------------------------------------------------------\n");
printf ("\n Mean Difference = %8.4f\n", diff);
printf ("\n Levene's Test for Equality of Variances: F= %.3f P= %.3f\n",