Oneway: Fix problems with MISSING=ANALYSIS
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 23 Aug 2010 15:00:57 +0000 (17:00 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Tue, 24 Aug 2010 14:37:20 +0000 (16:37 +0200)
src/language/stats/oneway.c

index 69570bbc6b9f2c76b396597387e7bdca5af3df2e..d08e3114c04d8155d6fe035000ba42745f05dc07 100644 (file)
@@ -469,16 +469,21 @@ run_oneway (const struct oneway_spec *cmd,
 
       for (i = 0; i < cmd->n_vars; ++i)
        {
+         const struct variable *v = cmd->vars[i];
+         const union value *val = case_data (c, v);
+
+         if ( MISS_ANALYSIS == cmd->missing_type)
+           {
+             if ( var_is_value_missing (v, val, cmd->exclude))
+               continue;
+           }
+
          {
            struct per_var_ws *pvw = &ws.vws[i];
 
            covariance_accumulate_pass1 (pvw->cov, c);
          }
 
-         const struct variable *v = cmd->vars[i];
-
-         const union value *val = case_data (c, v);
-
           struct group_proc *gp = group_proc_get (cmd->vars[i]);
          struct hsh_table *group_hash = gp->group_hash;
 
@@ -537,6 +542,15 @@ run_oneway (const struct oneway_spec *cmd,
       for (i = 0; i < cmd->n_vars; ++i)
        {
          struct per_var_ws *pvw = &ws.vws[i];
+         const struct variable *v = cmd->vars[i];
+         const union value *val = case_data (c, v);
+
+         if ( MISS_ANALYSIS == cmd->missing_type)
+           {
+             if ( var_is_value_missing (v, val, cmd->exclude))
+               continue;
+           }
+
          covariance_accumulate_pass2 (pvw->cov, c);
        }
     }