output: Introduce pivot tables.
[pspp] / tests / language / stats / means.at
index 0d990f85b125deaf82326b29e75366b8d6b64dd9..93ef68ac70ce63d159bb65275502c87383792ac8 100644 (file)
@@ -1,6 +1,23 @@
+dnl PSPP - a program for statistical analysis.
+dnl Copyright (C) 2017 Free Software Foundation, Inc.
+dnl 
+dnl This program is free software: you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation, either version 3 of the License, or
+dnl (at your option) any later version.
+dnl 
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+dnl GNU General Public License for more details.
+dnl 
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
+dnl
 AT_BANNER([MEANS procedure])
 
 AT_SETUP([MEANS simple example])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-simple.sps], [dnl
 SET FORMAT=F12.5.
@@ -44,8 +61,8 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-score: factor,26,100%,0,0%,26,100%
-score: ,26,100%,0,0%,26,100%
+score: factor,26,100.0%,0,.0%,26,100.0%
+score: ,26,100.0%,0,.0%,26,100.0%
 
 Table: Report
 ,factor,Mean,N,Std. Deviation
@@ -62,6 +79,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS very simple example])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-vsimple.sps], [dnl
 SET FORMAT=F12.5.
@@ -83,7 +101,7 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-score: ,4,100%,0,0%,4,100%
+score: ,4,100.0%,0,.0%,4,100.0%
 
 Table: Report
 ,Mean,N,Std. Deviation
@@ -96,6 +114,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS default missing])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-dmiss.sps], [dnl
 SET FORMAT=F12.2.
@@ -124,16 +143,16 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-a: g1 * g2,6,75%,2,25%,8,100%
-a: g2,6,75%,2,25%,8,100%
-a: ,7,87.5%,1,12.5%,8,100%
+a: g1 × g2,6,75.0%,2,25.0%,8,100.0%
+a: g2,6,75.0%,2,25.0%,8,100.0%
+a: ,7,87.5%,1,12.5%,8,100.0%
 
 Table: Report
 ,g1,g2,Mean,N
 a,1.00,11.00,4.00,1.00
-,1.00,21.00,3.00,1.00
-,2.00,21.00,6.00,1.00
-,2.00,31.00,5.67,3.00
+,,21.00,3.00,1.00
+,2.00,,6.00,1.00
+,,31.00,5.67,3.00
 
 Table: Report
 ,g2,Mean,N
@@ -150,6 +169,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS linear stats])
+AT_KEYWORDS([categorical categoricals])
 
 dnl Slightly more involved example to test the linear statistics
 AT_DATA([means-linear.sps], [dnl
@@ -182,8 +202,8 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-test1: group,10,100%,0,0%,10,100%
-test1: ,10,100%,0,0%,10,100%
+test1: group,10,100.0%,0,.0%,10,100.0%
+test1: ,10,100.0%,0,.0%,10,100.0%
 
 Table: Report
 ,group,Mean,N,Std. Deviation,Sum,Min,Max,Range,Variance,Kurtosis,Skewness
@@ -199,6 +219,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS standard errors])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-stderr.sps], [dnl
 set format F12.4.
@@ -227,8 +248,8 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-test1: group,10,100%,0,0%,10,100%
-test1: ,10,100%,0,0%,10,100%
+test1: group,10,100.0%,0,.0%,10,100.0%
+test1: ,10,100.0%,0,.0%,10,100.0%
 
 Table: Report
 ,group,Mean,N,S.E. Mean,S.E. Skew,S.E. Kurt
@@ -245,6 +266,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS harmonic and geometric means])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-hg.sps], [dnl
 set format F12.4.
@@ -270,8 +292,8 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-x: ,5,100%,0,0%,5,100%
-y: ,5,100%,0,0%,5,100%
+x: ,5,100.0%,0,.0%,5,100.0%
+y: ,5,100.0%,0,.0%,5,100.0%
 
 Table: Report
 ,Mean,Harmonic Mean,Geom. Mean
@@ -287,6 +309,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS all/none/default])
+AT_KEYWORDS([categorical categoricals])
 
 dnl Make sure that /CELLS = {ALL,NONE,DEFAULT} work properly
 AT_DATA([means-stat-keywords.sps], [dnl
@@ -314,7 +337,7 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-score: ,5,100%,0,0%,5,100%
+score: ,5,100.0%,0,.0%,5,100.0%
 
 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
@@ -324,7 +347,7 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-score: ,5,100%,0,0%,5,100%
+score: ,5,100.0%,0,.0%,5,100.0%
 
 Table: Report
 ,Mean,N,Std. Deviation
@@ -334,11 +357,9 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-score: ,5,100%,0,0%,5,100%
+score: ,5,100.0%,0,.0%,5,100.0%
 
 Table: Report
-
-score
 ])
 
 AT_CLEANUP
@@ -347,6 +368,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS missing=table ])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-miss-table.sps], [dnl
 data list notable list /a * b * g1.
@@ -373,16 +395,16 @@ MEANS a b BY g1
 ])
 
 
-AT_CHECK([pspp -O format=csv means-miss-table.sps], [0],
-  [dnl
+AT_CHECK([pspp -o pspp.csv -o pspp.txt means-miss-table.sps])
+AT_CHECK([cat pspp.csv], [0], [dnl
 Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-a: g1,7,100%,0,0%,7,100%
-a: ,7,100%,0,0%,7,100%
-b: g1,6,85.7143%,1,14.2857%,7,100%
-b: ,6,85.7143%,1,14.2857%,7,100%
+a: g1,7,100.0%,0,.0%,7,100.0%
+a: ,7,100.0%,0,.0%,7,100.0%
+b: g1,6,85.7%,1,14.3%,7,100.0%
+b: ,6,85.7%,1,14.3%,7,100.0%
 
 Table: Report
 ,g1,N
@@ -400,8 +422,8 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-a: g1,7,100%,0,0%,7,100%
-a: ,7,100%,0,0%,7,100%
+a: g1,7,100.0%,0,.0%,7,100.0%
+a: ,7,100.0%,0,.0%,7,100.0%
 
 Table: Report
 ,g1,N
@@ -416,10 +438,10 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-a: g1,7,100%,0,0%,7,100%
-a: ,7,100%,0,0%,7,100%
-b: g1,6,85.7143%,1,14.2857%,7,100%
-b: ,6,85.7143%,1,14.2857%,7,100%
+a: g1,7,100.0%,0,.0%,7,100.0%
+a: ,7,100.0%,0,.0%,7,100.0%
+b: g1,6,85.7%,1,14.3%,7,100.0%
+b: ,6,85.7%,1,14.3%,7,100.0%
 
 Table: Report
 ,g1,N
@@ -437,8 +459,8 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-a: g1,7,100%,0,0%,7,100%
-a: ,7,100%,0,0%,7,100%
+a: g1,7,100.0%,0,.0%,7,100.0%
+a: ,7,100.0%,0,.0%,7,100.0%
 
 Table: Report
 ,g1,N
@@ -449,14 +471,10 @@ Table: Report
 ,N
 a,7.00
 ])
-
 AT_CLEANUP
 
-
-
-
-
 AT_SETUP([MEANS user missing values])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-missing.sps], [dnl
 data list notable list /a * b * g1.
@@ -480,16 +498,16 @@ MEANS a b BY g1 /cells =  COUNT /missing = dependent .
 ])
 
 
-AT_CHECK([pspp -O format=csv means-missing.sps], [0],
-  [dnl
+AT_CHECK([pspp -o pspp.csv -o pspp.txt means-missing.sps])
+AT_CHECK([cat pspp.csv], [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%
-a: ,7,100%,0,0%,7,100%
-b: g1,5,71.4286%,2,28.5714%,7,100%
-b: ,6,85.7143%,1,14.2857%,7,100%
+a: g1,6,85.7%,1,14.3%,7,100.0%
+a: ,7,100.0%,0,.0%,7,100.0%
+b: g1,5,71.4%,2,28.6%,7,100.0%
+b: ,6,85.7%,1,14.3%,7,100.0%
 
 Table: Report
 ,g1,N
@@ -507,10 +525,10 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-a: g1,7,100%,0,0%,7,100%
-a: ,7,100%,0,0%,7,100%
-b: g1,7,100%,0,0%,7,100%
-b: ,7,100%,0,0%,7,100%
+a: g1,7,100.0%,0,.0%,7,100.0%
+a: ,7,100.0%,0,.0%,7,100.0%
+b: g1,7,100.0%,0,.0%,7,100.0%
+b: ,7,100.0%,0,.0%,7,100.0%
 
 Table: Report
 ,g1,N
@@ -530,10 +548,10 @@ Table: Case Processing Summary
 ,Cases,,,,,
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
-a: g1,7,100%,0,0%,7,100%
-a: ,7,100%,0,0%,7,100%
-b: g1,6,85.7143%,1,14.2857%,7,100%
-b: ,6,85.7143%,1,14.2857%,7,100%
+a: g1,7,100.0%,0,.0%,7,100.0%
+a: ,7,100.0%,0,.0%,7,100.0%
+b: g1,6,85.7%,1,14.3%,7,100.0%
+b: ,6,85.7%,1,14.3%,7,100.0%
 
 Table: Report
 ,g1,N
@@ -549,12 +567,12 @@ Table: Report
 a,7.00
 b,6.00
 ])
-
 AT_CLEANUP
 
 
 
 AT_SETUP([MEANS empty factor spec])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-bad.sps], [dnl
 data list list /outcome *.
@@ -575,6 +593,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS parser bug])
+AT_KEYWORDS([categorical categoricals])
 
 dnl This bug caused an infinite loop
 AT_DATA([means-bad.sps], [dnl