X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Fstats%2Fgraph.at;h=b61d8a522f477d1e83406f79841eeddc1da6fb9b;hb=e425c8f3444e1cb6ac5c9be967bcd204c2774c77;hp=5fc6f82cc4118bac91b8050944e3917cb871157c;hpb=5dbf5abcbed01f04422d4dead1c0ae0bb7efde4f;p=pspp diff --git a/tests/language/stats/graph.at b/tests/language/stats/graph.at index 5fc6f82cc4..b61d8a522f 100644 --- a/tests/language/stats/graph.at +++ b/tests/language/stats/graph.at @@ -41,6 +41,7 @@ AT_CLEANUP AT_SETUP([GRAPH Scatter and Histogram]) +AT_KEYWORDS([slow]) AT_DATA([scatterlong.sps],[ NEW FILE. INPUT PROGRAM. @@ -345,4 +346,92 @@ GRAPH /BAR = MINIMUM({) BY z BY y. AT_CHECK([pspp -o pspp.pdf barchart.sps], [1], [ignore]) dnl Ignore output -- this is just a no-crash check. -AT_CLEANUP \ No newline at end of file +AT_CLEANUP + + +dnl Check that percentages are calculated with respect to the +dnl proper total. See bug #56247 +AT_SETUP([GRAPH barchart percentage sub-categorical]) +AT_DATA([barchart.sps], [dnl +data list list notable /penalty_favopp_x * XYdem_racethW8 * w *. +begin data. +1 0 1960 +1 1 376 +2 0 678 +2 1 147 +4 0 368 +4 1 164 +5 0 427 +5 1 274 +. . 1522 +end data. + +weight by w. + +* crosstabs +* /tables=penalty_favopp_x by XYdem_racethW8 +* /format=AVALUE TABLES PIVOT +* /statistics=CHISQ +* /cells COUNT COLUMN TOTAL. + +graph + /bar=pct by penalty_favopp_x + . + +graph + /bar=pct by penalty_favopp_x by XYdem_racethW8 + . +]) + +AT_CHECK([pspp --testing barchart.sps], [0], [dnl +Graphic: Barchart +Percentage: 0 +Total Categories: 4 +Primary Categories: 4 +Largest Category: 53.1634 +Total Count: 100 +Y Label: "Percentage" +Categorical Variables: + Var: "penalty_favopp_x" +Categories: + 0 " 1.00" + 2 " 4.00" + 3 " 5.00" + 1 " 2.00" +All Categories: +Count: 53.1634; Cat: " 1.00" +Count: 18.7756; Cat: " 2.00" +Count: 12.1074; Cat: " 4.00" +Count: 15.9536; Cat: " 5.00" + +Graphic: Barchart +Percentage: 0 +Total Categories: 8 +Primary Categories: 4 +Largest Category: 57.0929 +Total Count: 200 +Y Label: "Percentage" +Categorical Variables: + Var: "penalty_favopp_x" + Var: "XYdem_racethW8" +Categories: + 0 " 1.00" + 2 " 4.00" + 3 " 5.00" + 1 " 2.00" +Sub-categories: + 0 " .00" + 1 " 1.00" +All Categories: +Count: 57.0929; Cat: " 1.00", " .00" +Count: 39.1259; Cat: " 1.00", " 1.00" +Count: 19.7495; Cat: " 2.00", " .00" +Count: 15.2966; Cat: " 2.00", " 1.00" +Count: 10.7195; Cat: " 4.00", " .00" +Count: 17.0656; Cat: " 4.00", " 1.00" +Count: 12.4381; Cat: " 5.00", " .00" +Count: 28.512; Cat: " 5.00", " 1.00" + +]) + +AT_CLEANUP