output: New page-setup-item.
[pspp] / tests / language / stats / means.at
index 5bef5e911cea5a65ff27c8e70f5c0493f9e17dee..d4db9ec8af3ca941b2f5e35886f072cdf0f62c05 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.
@@ -45,11 +62,16 @@ Table: Case Processing Summary
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
 score: factor,26,100%,0,0%,26,100%
+score: ,26,100%,0,0%,26,100%
 
 Table: Report
 ,factor,Mean,N,Std. Deviation
 score,1.00000,19.78947,19.00000,4.03566
 ,2.00000,24.00000,7.00000,5.50757
+
+Table: Report
+,Mean,N,Std. Deviation
+score,20.92308,26.00000,4.75750
 ])
 
 AT_CLEANUP
@@ -57,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.
@@ -91,6 +114,7 @@ AT_CLEANUP
 
 
 AT_SETUP([MEANS default missing])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-dmiss.sps], [dnl
 SET FORMAT=F12.2.
@@ -107,8 +131,8 @@ begin data.
 end data.
 
 MEANS TABLES = 
-      a BY g1
-      BY g2
+      a BY g1 g2
+      BY g2
       /cells = MEAN COUNT
       .
 ])
@@ -120,7 +144,8 @@ Table: Case Processing Summary
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
 a: g1 * g2,6,75%,2,25%,8,100%
-a: a * g2,6,75%,2,25%,8,100%
+a: g2,6,75%,2,25%,8,100%
+a: ,7,87.5%,1,12.5%,8,100%
 
 Table: Report
 ,g1,g2,Mean,N
@@ -130,19 +155,21 @@ a,1.00,11.00,4.00,1.00
 ,2.00,31.00,5.67,3.00
 
 Table: Report
-,a,g2,Mean,N
-a,2.00,31.00,2.00,1.00
-,3.00,21.00,3.00,1.00
-,4.00,11.00,4.00,1.00
-,6.00,21.00,6.00,1.00
-,7.00,31.00,7.00,1.00
-,8.00,31.00,8.00,1.00
+,g2,Mean,N
+a,11.00,4.00,1.00
+,21.00,4.50,2.00
+,31.00,5.67,3.00
+
+Table: Report
+,Mean,N
+a,5.00,6.00
 ])
 
 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
@@ -176,17 +203,23 @@ Table: Case Processing Summary
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
 test1: group,10,100%,0,0%,10,100%
+test1: ,10,100%,0,0%,10,100%
 
 Table: Report
 ,group,Mean,N,Std. Deviation,Sum,Min,Max,Range,Variance,Kurtosis,Skewness
 test1,experimental group,86.2000,5.0000,8.9833,431.0000,75.0000,99.0000,24.0000,80.7000,.2727,.3858
 ,control group,61.8000,5.0000,10.0598,309.0000,50.0000,71.0000,21.0000,101.2000,-3.0437,-.4830
+
+Table: Report
+,Mean,N,Std. Deviation,Sum,Min,Max,Range,Variance,Kurtosis,Skewness
+test1,74.0000,10.0000,15.6915,740.0000,50.0000,99.0000,49.0000,246.2222,-.5759,-.1262
 ])
 
 AT_CLEANUP
 
 
 AT_SETUP([MEANS standard errors])
+AT_KEYWORDS([categorical categoricals])
 
 AT_DATA([means-stderr.sps], [dnl
 set format F12.4.
@@ -216,11 +249,16 @@ Table: Case Processing Summary
 ,Included,,Excluded,,Total,
 ,N,Percent,N,Percent,N,Percent
 test1: group,10,100%,0,0%,10,100%
+test1: ,10,100%,0,0%,10,100%
 
 Table: Report
 ,group,Mean,N,S.E. Mean,S.E. Skew,S.E. Kurt
 test1,1.0000,83.5000,6.0000,4.2485,.8452,1.7408
 ,2.0000,59.7500,4.0000,5.1700,1.0142,2.6186
+
+Table: Report
+,Mean,N,S.E. Mean,S.E. Skew,S.E. Kurt
+test1,74.0000,10.0000,4.9621,.6870,1.3342
 ])
 
 AT_CLEANUP
@@ -228,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,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
@@ -330,6 +370,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.
@@ -363,7 +404,9 @@ Table: Case Processing Summary
 ,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%
 
 Table: Report
 ,g1,N
@@ -372,23 +415,35 @@ a,1.00,3.00
 b,1.00,3.00
 ,2.00,3.00
 
+Table: Report
+,N
+a,6.00
+b,6.00
+
 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%
 
 Table: Report
 ,g1,N
 a,1.00,3.00
 ,2.00,4.00
 
+Table: Report
+,N
+a,7.00
+
 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%
 
 Table: Report
 ,g1,N
@@ -397,16 +452,26 @@ a,1.00,3.00
 b,1.00,3.00
 ,2.00,3.00
 
+Table: Report
+,N
+a,7.00
+b,6.00
+
 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%
 
 Table: Report
 ,g1,N
 a,1.00,3.00
 ,2.00,4.00
+
+Table: Report
+,N
+a,7.00
 ])
 
 AT_CLEANUP
@@ -416,6 +481,7 @@ 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.
@@ -446,7 +512,9 @@ Table: Case Processing Summary
 ,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%
 
 Table: Report
 ,g1,N
@@ -455,12 +523,19 @@ a,1.00,2.00
 b,1.00,2.00
 ,2.00,3.00
 
+Table: Report
+,N
+a,6.00
+b,5.00
+
 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%
 
 Table: Report
 ,g1,N
@@ -471,12 +546,19 @@ b,1.00,2.00
 ,2.00,4.00
 ,9.00,1.00
 
+Table: Report
+,N
+a,7.00
+b,7.00
+
 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%
 
 Table: Report
 ,g1,N
@@ -486,9 +568,55 @@ a,1.00,2.00
 b,1.00,2.00
 ,2.00,3.00
 ,9.00,1.00
+
+Table: Report
+,N
+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 *.
+begin data.
+1
+2
+3
+end data.
+
+MEANS TABLES =  outcome 
+       BY.
+])
+
+AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])
+
+AT_CLEANUP
+
+
+
+AT_SETUP([MEANS parser bug])
+AT_KEYWORDS([categorical categoricals])
+
+dnl This bug caused an infinite loop
+AT_DATA([means-bad.sps], [dnl
+DATA LIST notable LIST /a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 fylo *.
+begin data.
+1 2 3 4 5 6 7 8 9 0 11
+end data.
+
+MEANS TABLES = a1 a2 a3 a4 a5 a6 a7 a8 a9 a10a BY fylo.
 ])
 
+AT_CHECK([pspp -O format=csv means-bad.sps], [1], [ignore])
+
 AT_CLEANUP
 
 
 
+