MEANS: Added further tests for missing value behaviour
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 16 Jan 2012 13:23:35 +0000 (14:23 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 16 Jan 2012 16:57:36 +0000 (17:57 +0100)
src/language/stats/means.c
tests/language/stats/means.at

index 7a6d5432ce7895f60701308a4da80a24e164a814..3b7bfeef091b328e366d5b6148fd078a54dc5fd8 100644 (file)
@@ -896,7 +896,8 @@ update_n (const void *aux1, void *aux2, void *user_data, const struct ccase *c,
 
       for (i = 0; i < table->n_interactions; ++i)
        {
-         if ( is_missing (means, table->dep_vars[v], table->interactions[i], c))
+         if ( is_missing (means, table->dep_vars[v],
+                          table->interactions[i], c))
            goto end;
        }
 
index e4d1f5a2f4e682685b7b6db0bec68fe710723936..5bef5e911cea5a65ff27c8e70f5c0493f9e17dee 100644 (file)
@@ -413,3 +413,82 @@ AT_CLEANUP
 
 
 
+
+
+AT_SETUP([MEANS user missing values])
+
+AT_DATA([means-missing.sps], [dnl
+data list notable list /a * b * g1.
+begin data.
+1 2 9  
+2 2 1 
+3 2 1 
+4 2 2 
+5 2 2 
+6 2 2 
+7 9 2 
+end data.
+
+MISSING VALUES a b g1 (9).
+
+MEANS a b BY g1 /cells =  COUNT .
+
+MEANS a b BY g1 /cells =  COUNT /missing = include .
+
+MEANS a b BY g1 /cells =  COUNT /missing = dependent .
+])
+
+
+AT_CHECK([pspp -O format=csv means-missing.sps], [0],
+  [dnl
+Table: Case Processing Summary
+,Cases,,,,,
+,Included,,Excluded,,Total,
+,N,Percent,N,Percent,N,Percent
+a: g1,6,85.7143%,1,14.2857%,7,100%
+b: g1,5,71.4286%,2,28.5714%,7,100%
+
+Table: Report
+,g1,N
+a,1.00,2.00
+,2.00,4.00
+b,1.00,2.00
+,2.00,3.00
+
+Table: Case Processing Summary
+,Cases,,,,,
+,Included,,Excluded,,Total,
+,N,Percent,N,Percent,N,Percent
+a: g1,7,100%,0,0%,7,100%
+b: g1,7,100%,0,0%,7,100%
+
+Table: Report
+,g1,N
+a,1.00,2.00
+,2.00,4.00
+,9.00,1.00
+b,1.00,2.00
+,2.00,4.00
+,9.00,1.00
+
+Table: Case Processing Summary
+,Cases,,,,,
+,Included,,Excluded,,Total,
+,N,Percent,N,Percent,N,Percent
+a: g1,7,100%,0,0%,7,100%
+b: g1,6,85.7143%,1,14.2857%,7,100%
+
+Table: Report
+,g1,N
+a,1.00,2.00
+,2.00,4.00
+,9.00,1.00
+b,1.00,2.00
+,2.00,3.00
+,9.00,1.00
+])
+
+AT_CLEANUP
+
+
+