X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Ffrequencies.at;h=1d91a6e292465eea313052b99ecd142a88c452b6;hb=e246f73b3dfceae79a23056fee0a18bb4a08bc33;hp=ca0467264e84a7f63abf8cec3cc40a846c0129e5;hpb=5cab4cf3322f29c0ed7134d23740e07382914f20;p=pspp diff --git a/tests/language/stats/frequencies.at b/tests/language/stats/frequencies.at index ca0467264e..1d91a6e292 100644 --- a/tests/language/stats/frequencies.at +++ b/tests/language/stats/frequencies.at @@ -1,16 +1,16 @@ dnl PSPP - a program for statistical analysis. dnl Copyright (C) 2017 Free Software Foundation, Inc. -dnl +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 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 dnl You should have received a copy of the GNU General Public License dnl along with this program. If not, see . dnl @@ -54,7 +54,7 @@ AT_DATA([frequencies.sps], [data list free /v1 v2. begin data. 0 1 -2 3 +2 3 4 5 3 4 end data. @@ -127,7 +127,7 @@ AT_DATA([frequencies.sps], [data list free /v1 v2. begin data. 0 1 -2 3 +2 3 4 5 3 4 end data. @@ -212,14 +212,14 @@ end data. weight by w. -frequencies /x - /format=notable +frequencies /x + /format=notable /statistics=none /histogram=minimum(0) maximum(50) percent(5) normal. ]) # Cannot use the CSV driver for this because it does not output charts # at all. -AT_CHECK([pspp -O format=pdf frequencies.sps], [0], [ignore]) +AT_CHECK([pspp -O format=pdf frequencies.sps], [0], [ignore], [ignore]) AT_CLEANUP # Tests for a bug which crashed PSPP when the median and a histogram @@ -307,14 +307,14 @@ AT_SETUP([FREQUENCIES basic percentiles]) AT_DATA([frequencies.sps], [DATA LIST LIST notable /x * . BEGIN DATA. -1 -2 -3 -4 +1 +2 +3 +4 5 END DATA. -FREQUENCIES +FREQUENCIES VAR=x /FORMAT=NOTABLE /PERCENTILES = 0 25 33.333 50 66.666 75 100. @@ -327,14 +327,14 @@ AT_SETUP([FREQUENCIES basic n-tiles]) AT_DATA([frequencies.sps], [DATA LIST LIST notable /x * . BEGIN DATA. -1 -2 -3 -4 +1 +2 +3 +4 5 END DATA. -FREQUENCIES +FREQUENCIES VAR=x /FORMAT=NOTABLE /NTILES = 3 @@ -348,14 +348,14 @@ AT_SETUP([FREQUENCIES compatibility percentiles]) AT_DATA([frequencies.sps], [DATA LIST LIST notable /X * . BEGIN DATA. -1 -2 -3 -4 +1 +2 +3 +4 5 END DATA. -FREQUENCIES +FREQUENCIES VAR=x /ALGORITHM=COMPATIBLE /PERCENTILES = 0 25 50 75 100. @@ -390,14 +390,14 @@ AT_SETUP([FREQUENCIES enhanced percentiles]) AT_DATA([frequencies.sps], [DATA LIST LIST notable /X * . BEGIN DATA. -1 -2 -3 -4 +1 +2 +3 +4 5 END DATA. -FREQUENCIES +FREQUENCIES VAR=x /PERCENTILES = 0 25 50 75 100. ]) @@ -442,7 +442,7 @@ END DATA. WEIGHT BY f. -FREQUENCIES +FREQUENCIES VAR=x /PERCENTILES = 0 25 50 75 100. ]) @@ -485,7 +485,7 @@ END DATA. WEIGHT BY f. -FREQUENCIES +FREQUENCIES VAR=x /PERCENTILES = 0 25 50 75 100. ]) @@ -527,7 +527,7 @@ END DATA. WEIGHT BY f. -FREQUENCIES +FREQUENCIES VAR=x /PERCENTILES = 0 25 50 75 100. ]) @@ -571,7 +571,7 @@ END DATA. MISSING VALUE x (99.0) . WEIGHT BY f. -FREQUENCIES +FREQUENCIES VAR=x /PERCENTILES = 0 25 50 75 100. ]) @@ -606,23 +606,23 @@ AT_SETUP([FREQUENCIES dichotomous histogram]) AT_DATA([frequencies.sps], [dnl data list notable list /d4 *. begin data. -0 -0 -0 -1 -0 -0 -0 -0 -1 -0 -0 -0 -0 -0 -1 -2 -0 +0 +0 +0 +1 +0 +0 +0 +0 +1 +0 +0 +0 +0 +0 +1 +2 +0 end data. FREQUENCIES @@ -793,9 +793,9 @@ Maximum,,. @&t@ Sum,,. @&t@ Table: x -,,Frequency,Percent,Valid Percent,Cumulative Percent -Missing,. ,3,100.0%,, -Total,,3,.0%,, +,,Frequency,Percent +Missing,. ,3,100.0% +Total,,3,.0% ]) AT_CLEANUP @@ -845,3 +845,44 @@ FREQUENCIES VARIABLES=SCORE AT_CHECK([pspp bug.sps], [0], [ignore]) AT_CLEANUP + + +AT_SETUP([FREQUENCIES vs. missing weights]) +AT_DATA([warn.sps], [dnl +data list notable list /x w . +begin data. +1 1 +2 1 +1 1 +3 1 +3 . +4 . +end data. + +weight by w. + +frequencies /variables=x. +]) + +AT_CHECK([pspp warn.sps -O format=csv], [0], [dnl +"warn.sps:13: warning: FREQUENCIES: At least one case in the data file had a weight value that was user-missing, system-missing, zero, or negative. These case(s) were ignored." + +Table: Statistics +,,x +N,Valid,4.00 +,Missing,.00 +Mean,,1.75 +Std Dev,,.96 +Minimum,,1.00 +Maximum,,4.00 + +Table: x +,,Frequency,Percent,Valid Percent,Cumulative Percent +Valid,1.00,2.00,50.0%,50.0%,50.0% +,2.00,1.00,25.0%,25.0%,75.0% +,3.00,1.00,25.0%,25.0%,100.0% +,4.00,.00,.0%,.0%,100.0% +Total,,4.00,100.0%,, +]) + +AT_CLEANUP