lexer: New function lex_ofs_representation().
[pspp] / src / language / stats / mann-whitney.c
index ad3a95733ed76ff35b9b10e6c7530461a9c8fc52..2301cd13c53ed207643e4314408c19fc4cb88171 100644 (file)
@@ -68,10 +68,10 @@ belongs_to_test (const struct ccase *c, void *aux)
   const union value *group = case_data (c, nst->indep_var);
   const size_t group_var_width = var_get_width (nst->indep_var);
 
-  if ( value_equal (group, &nst->val1, group_var_width))
+  if (value_equal (group, &nst->val1, group_var_width))
     return true;
 
-  if ( value_equal (group, &nst->val2, group_var_width))
+  if (value_equal (group, &nst->val2, group_var_width))
     return true;
 
   return false;
@@ -94,7 +94,7 @@ mann_whitney_execute (const struct dataset *ds,
   const struct caseproto *proto = casereader_get_proto (input);
   size_t rank_idx = caseproto_get_n_widths (proto);
 
-  struct mw *mw = xcalloc (nst->n_vars, sizeof *mw);
+  struct mw *mw = XCALLOC (nst->n_vars,  struct mw);
 
   for (i = 0; i < nst->n_vars; ++i)
     {
@@ -127,14 +127,14 @@ mann_whitney_execute (const struct dataset *ds,
        {
          const union value *group = case_data (c, nst->indep_var);
          const size_t group_var_width = var_get_width (nst->indep_var);
-         const double rank = case_data_idx (c, rank_idx)->f;
+         const double rank = case_num_idx (c, rank_idx);
 
-         if ( value_equal (group, &nst->val1, group_var_width))
+         if (value_equal (group, &nst->val1, group_var_width))
            {
              mw[i].rank_sum[0] += rank;
              mw[i].n[0] += dict_get_case_weight (dict, c, &warn);
            }
-         else if ( value_equal (group, &nst->val2, group_var_width))
+         else if (value_equal (group, &nst->val2, group_var_width))
            {
              mw[i].rank_sum[1] += rank;
              mw[i].n[1] += dict_get_case_weight (dict, c, &warn);
@@ -152,7 +152,7 @@ mann_whitney_execute (const struct dataset *ds,
        mwv->u -= mwv->rank_sum[0];
 
        mwv->w = mwv->rank_sum[1];
-       if ( mwv->u > mwv->n[0] * mwv->n[1] / 2.0)
+       if (mwv->u > mwv->n[0] * mwv->n[1] / 2.0)
          {
            mwv->u =  mwv->n[0] * mwv->n[1] - mwv->u;
            mwv->w = mwv->rank_sum[0];