From: John Darrington Date: Mon, 16 Jan 2012 13:23:35 +0000 (+0100) Subject: MEANS: Added further tests for missing value behaviour X-Git-Tag: v0.7.9~29 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b453534cce1efa7ac28ab33679f037e487ac354;p=pspp-builds.git MEANS: Added further tests for missing value behaviour --- diff --git a/src/language/stats/means.c b/src/language/stats/means.c index 7a6d5432..3b7bfeef 100644 --- a/src/language/stats/means.c +++ b/src/language/stats/means.c @@ -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; } diff --git a/tests/language/stats/means.at b/tests/language/stats/means.at index e4d1f5a2..5bef5e91 100644 --- a/tests/language/stats/means.at +++ b/tests/language/stats/means.at @@ -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 + + +