/* PSPP - EXAMINE data for normality . -*-c-*-
Copyright (C) 2004 Free Software Foundation, Inc.
-Author: John Darrington 2004, 2006
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
static struct cmd_examine cmd;
-static struct variable **dependent_vars;
+static const struct variable **dependent_vars;
static size_t n_dependent_vars;
/* Output functions */
-static void show_summary (struct variable **dependent_var, int n_dep_var,
+static void show_summary (const struct variable **dependent_var, int n_dep_var,
const struct factor *f);
-static void show_extremes (struct variable **dependent_var,
+static void show_extremes (const struct variable **dependent_var,
int n_dep_var,
const struct factor *factor,
int n_extremities);
-static void show_descriptives (struct variable **dependent_var,
+static void show_descriptives (const struct variable **dependent_var,
int n_dep_var,
struct factor *factor);
-static void show_percentiles (struct variable **dependent_var,
+static void show_percentiles (const struct variable **dependent_var,
int n_dep_var,
struct factor *factor);
-/* Function to use for testing for missing values */
-static var_is_missing_func *value_is_missing;
-
+/* Categories of missing values to exclude. */
+static enum mv_class exclude_values;
/* PERCENTILES */
}
/* If /MISSING=INCLUDE is set, then user missing values are ignored */
- if (cmd.incl == XMN_INCLUDE )
- value_is_missing = var_is_value_system_missing;
- else
- value_is_missing = var_is_value_missing;
+ exclude_values = cmd.incl == XMN_INCLUDE ? MV_SYSTEM : MV_ANY;
if ( cmd.st_n == SYSMIS )
cmd.st_n = 5;
return 2;
}
- if (!parse_variables (lexer, dict, &dependent_vars, &n_dependent_vars,
+ if (!parse_variables_const (lexer, dict, &dependent_vars, &n_dependent_vars,
PV_NO_DUPLICATE | PV_NUMERIC | PV_NO_SCRATCH) )
{
free (dependent_vars);
var_get_width (var)
);
- if ( value_is_missing (var, val) || case_missing )
+ if (case_missing || var_is_value_missing (var, val, exclude_values))
{
free (val);
continue;
var_get_width (var)
);
- if ( value_is_missing (var, val))
+ if ( var_is_value_missing (var, val, exclude_values))
case_missing = 1;
free (val);
var_get_width (var)
);
- if ( value_is_missing (var, val) || case_missing )
+ if ( var_is_value_missing (var, val, exclude_values)
+ || case_missing )
{
free (val) ;
continue ;
static void
-show_summary (struct variable **dependent_var, int n_dep_var,
+show_summary (const struct variable **dependent_var, int n_dep_var,
const struct factor *fctr)
{
static const char *subtitle[]=
static void
-show_extremes (struct variable **dependent_var, int n_dep_var,
+show_extremes (const struct variable **dependent_var, int n_dep_var,
const struct factor *fctr, int n_extremities)
{
int i;
/* Show the descriptives table */
void
-show_descriptives (struct variable **dependent_var,
+show_descriptives (const struct variable **dependent_var,
int n_dep_var,
struct factor *fctr)
{
}
-
-
/* Fill in the descriptives data */
void
populate_descriptives (struct tab_table *tbl, int col, int row,
const struct metrics *m)
{
-
- const double t = gsl_cdf_tdist_Qinv (1 - cmd.n_cinterval[0]/100.0/2.0, \
+ const double t = gsl_cdf_tdist_Qinv ((1 - cmd.n_cinterval[0] / 100.0)/2.0,
m->n -1);
-
tab_text (tbl, col,
row,
TAB_LEFT | TAT_TITLE,
/* Show the percentiles */
void
-show_percentiles (struct variable **dependent_var,
+show_percentiles (const struct variable **dependent_var,
int n_dep_var,
struct factor *fctr)
{