#include <data/casegrouper.h>
#include <data/casereader.h>
#include <data/casewriter.h>
-#include <data/case-ordering.h>
#include <data/dictionary.h>
#include <data/procedure.h>
+#include <data/subcase.h>
#include <data/value-labels.h>
#include <data/variable.h>
#include <language/command.h>
struct statistic *histogram;
struct order_stats *np;
- /* Tukey_Hingesree quartiles indexing into PTL */
+ /* Three quartiles indexing into PTL */
struct percentile **quartiles;
/* A reader sorted in ASCENDING order */
struct casereader *up_reader;
- /* Tukey_Hingese minimum value of all tukey_hingese weights */
+ /* The minimum value of all the weights */
double cmin;
- /* Sum of all weights, including tukey_hingesose for missing values */
+ /* Sum of all weights, including those for missing values */
double n;
double mean;
struct xfactor
{
- /* We need to make a list of tukey_hingesis structure */
+ /* We need to make a list of this structure */
struct ll ll;
- /* Tukey_Hingese independent variable */
+ /* The independent variable */
const struct variable const* indep_var[2];
- /* A list of results for tukey_hingesis factor */
+ /* A list of results for this factor */
struct ll_list result_list ;
};
static struct xfactor level0_factor;
static struct ll_list factor_list = LL_INITIALIZER (factor_list);
-/* Parse tukey_hingese clause specifying tukey_hingese factors */
+/* Parse the clause specifying the factors */
static int examine_parse_independent_vars (struct lexer *lexer,
const struct dictionary *dict,
struct cmd_examine *cmd);
/* Represent a factor as a string, so it can be
printed in a human readable fashion,
- but sacrificing some readablility for tukey_hingese sake of brevity */
+ but sacrificing some readablility for the sake of brevity */
static void
factor_to_string_concise (const struct xfactor *fctr,
const struct factor_result *result,
return CMD_FAILURE;
}
- /* If /MISSING=INCLUDE is set, tukey_hingesen user missing values are ignored */
+ /* If /MISSING=INCLUDE is set, then user missing values are ignored */
exclude_values = cmd.incl == XMN_INCLUDE ? MV_SYSTEM : MV_ANY;
if ( cmd.st_n == SYSMIS )
if ( ! cmd.sbc_cinterval)
cmd.n_cinterval[0] = 95.0;
- /* If descriptives have been requested, make sure tukey_hingese
+ /* If descriptives have been requested, make sure the
quartiles are calculated */
if ( cmd.a_statistics[XMN_ST_DESCRIPTIVES] )
{
{
/* In this case, we need to sort the data, so we create a sorting
casewriter */
- struct case_ordering *up_ordering = case_ordering_create ();
-
- case_ordering_add_var (up_ordering, dependent_vars[v], SRT_ASCEND);
- writer = sort_create_writer (up_ordering,
+ struct subcase up_ordering;
+ subcase_init_var (&up_ordering, dependent_vars[v], SC_ASCEND);
+ writer = sort_create_writer (&up_ordering,
casereader_get_value_cnt (reader));
+ subcase_destroy (&up_ordering);
}
else
{
order_stats_accumulate (os, n_os,
casereader_clone (metric->up_reader),
- wv, dependent_vars[v]);
+ wv, dependent_vars[v], MV_ANY);
free (os);
}
}
order_stats_accumulate ((struct order_stats **) &metric->box_whisker,
1,
casereader_clone (metric->up_reader),
- wv, dependent_vars[v]);
+ wv, dependent_vars[v], MV_ANY);
}
}
struct casereader *group = NULL;
struct casereader *level1;
struct casegrouper *grouper1 = NULL;
- struct case_ordering *ordering1 = case_ordering_create ();
- case_ordering_add_var (ordering1, factor->indep_var[0], SRT_ASCEND);
level1 = casereader_clone (input);
-
- level1 = sort_execute (level1,
- case_ordering_clone (ordering1));
- grouper1 = casegrouper_create_case_ordering (level1, ordering1);
- case_ordering_destroy (ordering1);
+ level1 = sort_execute_1var (level1, factor->indep_var[0]);
+ grouper1 = casegrouper_create_vars (level1, &factor->indep_var[0], 1);
while (casegrouper_get_next_group (grouper1, &group))
{
int n_groups = 0;
struct casereader *group2 = NULL;
struct casegrouper *grouper2 = NULL;
- struct case_ordering *ordering2 = case_ordering_create ();
- case_ordering_add_var (ordering2,
- factor->indep_var[1], SRT_ASCEND);
- group_copy = sort_execute (group_copy,
- case_ordering_clone (ordering2));
- grouper2 =
- casegrouper_create_case_ordering (group_copy, ordering2);
+ group_copy = sort_execute_1var (group_copy,
+ factor->indep_var[1]);
- case_ordering_destroy (ordering2);
+ grouper2 = casegrouper_create_vars (group_copy,
+ &factor->indep_var[1], 1);
while (casegrouper_get_next_group (grouper2, &group2))
{
{
if ( last_value == NULL ||
- compare_values (last_value, result->value[0],
- var_get_width(fctr->indep_var[0])))
+ compare_values_short (last_value, result->value[0],
+ fctr->indep_var[0]))
{
struct string str;