MEANS: Added further tests for missing value behaviour
[pspp-builds.git] / tests / language / stats / means.at
index 51d74e2eb725af9b8a43c51d83b470a775d475f6..5bef5e911cea5a65ff27c8e70f5c0493f9e17dee 100644 (file)
@@ -263,3 +263,232 @@ y,3.0000,3.0000,3.0000
 ])
 
 AT_CLEANUP
+
+
+
+
+
+
+AT_SETUP([MEANS all/none/default])
+
+dnl Make sure that /CELLS = {ALL,NONE,DEFAULT} work properly
+AT_DATA([means-stat-keywords.sps], [dnl
+SET FORMAT=F12.2.
+SET DECIMAL=DOT.
+
+DATA LIST NOTABLE LIST /score *.
+BEGIN DATA.
+22
+22
+29
+16
+23
+END DATA.
+
+MEANS score /CELLS = ALL.
+MEANS score /CELLS = DEFAULT.
+MEANS score /CELLS = NONE.
+])
+
+
+AT_CHECK([pspp -O format=csv means-stat-keywords.sps], [0],
+  [dnl
+Table: Case Processing Summary
+,Cases,,,,,
+,Included,,Excluded,,Total,
+,N,Percent,N,Percent,N,Percent
+score: ,5,100%,0,0%,5,100%
+
+Table: Report
+,Mean,N,Std. Deviation,S.E. Mean,Sum,Min,Max,Range,Variance,Kurtosis,S.E. Kurt,Skewness,S.E. Skew,First,Last,Harmonic Mean,Geom. Mean
+score,22.40,5.00,4.62,2.06,112.00,16.00,29.00,13.00,21.30,1.85,2.00,.11,.91,22.00,23.00,21.61,22.01
+
+Table: Case Processing Summary
+,Cases,,,,,
+,Included,,Excluded,,Total,
+,N,Percent,N,Percent,N,Percent
+score: ,5,100%,0,0%,5,100%
+
+Table: Report
+,Mean,N,Std. Deviation
+score,22.40,5.00,4.62
+
+Table: Case Processing Summary
+,Cases,,,,,
+,Included,,Excluded,,Total,
+,N,Percent,N,Percent,N,Percent
+score: ,5,100%,0,0%,5,100%
+
+Table: Report
+
+score
+])
+
+AT_CLEANUP
+
+
+
+
+AT_SETUP([MEANS missing=table ])
+
+AT_DATA([means-miss-table.sps], [dnl
+data list notable list /a * b * g1.
+begin data.
+1 9 1  
+2 9 1 
+3 9 1 
+4 9 2 
+5 9 2 
+6 9 2 
+7 . 2 
+end data.
+
+MEANS a b BY g1
+      /a  BY g1
+      /cells =  COUNT
+      /missing = TABLE
+      .
+
+MEANS a b BY g1
+      /a  BY g1
+      /cells =  COUNT
+      .
+])
+
+
+AT_CHECK([pspp -O format=csv means-miss-table.sps], [0],
+  [dnl
+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,3.00
+,2.00,3.00
+b,1.00,3.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%
+
+Table: Report
+,g1,N
+a,1.00,3.00
+,2.00,4.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,3.00
+,2.00,4.00
+b,1.00,3.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%
+
+Table: Report
+,g1,N
+a,1.00,3.00
+,2.00,4.00
+])
+
+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
+
+
+