+
+
+AT_SETUP([FREQUENCIES median])
+AT_DATA([median.sps], [dnl
+data list notable list /x *.
+begin data.
+1
+2
+3000000
+end data.
+
+FREQUENCIES
+ /VARIABLES = x
+ /STATISTICS = MEDIAN
+ .
+])
+
+AT_CHECK([pspp median.sps -O format=csv], [0], [dnl
+Table: x
+Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
+,1.00,1,33.33,33.33,33.33
+,2.00,1,33.33,33.33,66.67
+,3000000.00,1,33.33,33.33,100.00
+Total,,3,100.0,100.0,
+
+Table: x
+N,Valid,3
+,Missing,0
+Percentiles,50 (Median),2.00
+])
+AT_CLEANUP
+
+AT_SETUP([FREQUENCIES variance])
+AT_DATA([variance.sps], [dnl
+data list notable list /forename (A12) height.
+begin data.
+Ahmed 188
+bertram 167
+Catherine 134
+David 109
+end data.
+
+FREQUENCIES
+ /VARIABLES = height
+ /STATISTICS = VARIANCE.
+])
+
+AT_CHECK([pspp variance.sps -O format=csv], [0], [dnl
+Table: height
+Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
+,109.00,1,25.00,25.00,25.00
+,134.00,1,25.00,25.00,50.00
+,167.00,1,25.00,25.00,75.00
+,188.00,1,25.00,25.00,100.00
+Total,,4,100.0,100.0,
+
+Table: height
+N,Valid,4
+,Missing,0
+Variance,,1223.00
+])
+AT_CLEANUP
+
+AT_SETUP([FREQUENCIES default statistics])
+AT_DATA([median.sps], [dnl
+data list notable list /x *.
+begin data.
+10
+20
+3000000
+end data.
+
+FREQUENCIES
+ /VARIABLES = x
+ /STATISTICS
+ .
+
+FREQUENCIES
+ /VARIABLES = x
+ /STATISTICS = DEFAULT
+ .
+])
+
+AT_CHECK([pspp median.sps -O format=csv], [0], [dnl
+Table: x
+Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
+,10.00,1,33.33,33.33,33.33
+,20.00,1,33.33,33.33,66.67
+,3000000.00,1,33.33,33.33,100.00
+Total,,3,100.0,100.0,
+
+Table: x
+N,Valid,3
+,Missing,0
+Mean,,1000010.00
+Std Dev,,1732042.15
+Minimum,,10.00
+Maximum,,3000000.00
+
+Table: x
+Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
+,10.00,1,33.33,33.33,33.33
+,20.00,1,33.33,33.33,66.67
+,3000000.00,1,33.33,33.33,100.00
+Total,,3,100.0,100.0,
+
+Table: x
+N,Valid,3
+,Missing,0
+Mean,,1000010.00
+Std Dev,,1732042.15
+Minimum,,10.00
+Maximum,,3000000.00
+])
+AT_CLEANUP
+
+
+
+AT_SETUP([FREQUENCIES no valid data])
+AT_DATA([empty.sps], [dnl
+data list notable list /x *.
+begin data.
+.
+.
+.
+end data.
+
+FREQUENCIES
+ /VARIABLES = x
+ /STATISTICS = ALL
+ .
+])
+
+AT_CHECK([pspp empty.sps -O format=csv], [0], [dnl
+Table: x
+Value Label,Value,Frequency,Percent,Valid Percent,Cum Percent
+,. ,3,100.00,Missing,
+Total,,3,100.0,100.0,
+
+Table: x
+N,Valid,0
+,Missing,3
+Mean,,.
+S.E. Mean,,.
+Mode,,.
+Std Dev,,.
+Variance,,.
+Kurtosis,,.
+S.E. Kurt,,.
+Skewness,,.
+S.E. Skew,,.
+Range,,.
+Minimum,,.
+Maximum,,.
+Sum,,.
+Percentiles,,.
+])
+
+AT_CLEANUP
+
+
+AT_SETUP([FREQUENCIES histogram no valid cases])
+AT_DATA([empty.sps], [dnl
+data list notable list /x w *.
+begin data.
+1 .
+2 .
+3 .
+end data.
+
+weight by w.
+
+FREQUENCIES
+ /VARIABLES = x
+ /histogram
+ .
+])
+
+AT_CHECK([pspp empty.sps -O format=csv], [0], [ignore])
+
+AT_CLEANUP
+
+AT_SETUP([FREQUENCIES percentiles + histogram bug#48128])
+AT_DATA([bug.sps], [dnl
+SET FORMAT=F8.0.
+
+INPUT PROGRAM.
+ LOOP I=1 TO 10.
+ COMPUTE SCORE=EXP(NORMAL(1)).
+ END CASE.
+ END LOOP.
+ END FILE.
+END INPUT PROGRAM.
+
+FREQUENCIES VARIABLES=SCORE
+/FORMAT=NOTABLE
+/STATISTICS=ALL
+/PERCENTILES=1 10 20 30 40 50 60 70 80 90 99
+/HISTOGRAM.
+
+])
+
+AT_CHECK([pspp bug.sps], [0], [ignore])
+
+AT_CLEANUP