1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
4 dnl This program is free software: you can redistribute it and/or modify
5 dnl it under the terms of the GNU General Public License as published by
6 dnl the Free Software Foundation, either version 3 of the License, or
7 dnl (at your option) any later version.
9 dnl This program is distributed in the hope that it will be useful,
10 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 dnl GNU General Public License for more details.
14 dnl You should have received a copy of the GNU General Public License
15 dnl along with this program. If not, see <http://www.gnu.org/licenses/>.
19 AT_SETUP([GRAPH simple scatterplot])
20 AT_DATA([scatterplot.sps],[
21 * Simple Scatterplot test
25 COMPUTE Age = RV.NORMAL(40,10).
31 COMPUTE Size = Age * 3 + 50.
34 /SCATTERPLOT(BIVARIATE) = Age WITH Size.
38 AT_CHECK([pspp -O format=csv scatterplot.sps], [0], [ignore])
43 AT_SETUP([GRAPH Scatter and Histogram])
44 AT_DATA([scatterlong.sps],[
48 COMPUTE Age = RV.NORMAL(40,10).
49 COMPUTE CityNum = TRUNC(UNIFORM(2.95)).
55 COMPUTE Size = Age * 3 + 50 + 50*CityNum.
66 /SCATTERPLOT(BIVARIATE) = Age WITH Size
69 /SCATTERPLOT(BIVARIATE) = Age WITH CityNum
72 /SCATTERPLOT = CityNum WITH Age
75 /SCATTERPLOT = CityNum WITH Size
78 /SCATTERPLOT(BIVARIATE) = Age WITH Size BY City
81 /SCATTERPLOT(BIVARIATE) = Age WITH Size BY CityNum
84 /CityNum 1 'Rio' 2 'Tokyo' 0 'Mumbai'.
87 /SCATTERPLOT(BIVARIATE) = Age WITH Size BY CityNum
94 AT_CHECK([pspp -O format=pdf scatterlong.sps], [0], [ignore])
97 AT_SETUP([GRAPH missing values don't crash])
98 AT_DATA([scatter.sps], [dnl
99 data list list /x * y *.
110 /scatterplot = x with y.
114 AT_CHECK([pspp -o pspp.pdf scatter.sps])
115 dnl Ignore output -- this is just a no-crash check.
118 AT_SETUP([GRAPH missing=VARIABLE no crash])
119 AT_DATA([scatter.sps], [dnl
120 data list list /x * y *.
131 /scatterplot = x with y
137 AT_CHECK([pspp -o pspp.pdf scatter.sps])
138 dnl Ignore output -- this is just a no-crash check.
141 AT_SETUP([GRAPH missing value in by variable])
142 AT_DATA([scatter.sps], [dnl
143 data list list /x * y * z *.
154 /scatterplot = x with y by z
158 /scatterplot = x with y by z.
161 AT_CHECK([pspp -o pspp.pdf scatter.sps])
162 dnl Ignore output -- this is just a no-crash check.
166 AT_SETUP([GRAPH histogram with null data])
167 AT_DATA([null-hist.sps], [dnl
179 AT_CHECK([pspp -o pspp.pdf null-hist.sps], [0], [ignore])
180 dnl Ignore output -- this is just a no-crash check.
184 AT_SETUP([GRAPH histogram all missing])
185 AT_DATA([null-hist.sps], [dnl
196 AT_CHECK([pspp null-hist.sps], [0], [ignore])
197 dnl Ignore output -- this is just a no-crash check.
203 AT_SETUP([GRAPH barcharts])
204 AT_CHECK([ln -s $top_srcdir/examples/physiology.sav .], [0])
205 AT_CHECK([ln -s $top_srcdir/examples/repairs.sav .], [0])
207 AT_DATA([barchart.sps], [dnl
208 GET FILE="physiology.sav".
210 GRAPH /BAR = COUNT BY SEX.
212 GRAPH /BAR = MEAN(height) BY SEX.
216 GET FILE="repairs.sav".
218 GRAPH /BAR = MEAN (mtbf) BY factory.
220 COMPUTE R = TRUNC(RV.UNIFORM(1,5)).
222 GRAPH /BAR = MEAN (mtbf) BY factory BY R.
225 AT_CHECK([pspp -o pspp.pdf barchart.sps], [0], [ignore])
226 dnl Ignore output -- this is just a no-crash check.
232 AT_SETUP([GRAPH barchart arity])
234 AT_DATA([barchart.sps], [dnl
235 data list notable list /x y z*.
249 * This line is invalid
250 GRAPH /BAR = COUNT(x) BY y.
253 AT_CHECK([pspp -o pspp.pdf barchart.sps], [1], [ignore])
254 dnl Ignore output -- this is just a no-crash check.
261 AT_SETUP([GRAPH barchart bad syntax])
263 AT_DATA([barchart.sps], [dnl
264 data list notable list /x y z*.
278 * This line is invalid
279 GRAPH /BAR = SCROD BY y.
282 AT_CHECK([pspp -o pspp.pdf barchart.sps], [1], [ignore])
283 dnl Ignore output -- this is just a no-crash check.
289 AT_SETUP([GRAPH barchart full])
291 AT_DATA([barchart.sps], [dnl
292 data list notable list /x y z*.
306 * This line is invalid
307 GRAPH /BAR = COUNT by z.
308 GRAPH /BAR = CUFREQ by z.
309 GRAPH /BAR = PCT by z.
310 GRAPH /BAR = CUPCT by z.
312 GRAPH /BAR = MEAN(y) BY z.
313 GRAPH /BAR = SUM(y) BY z.
314 GRAPH /BAR = MAXIMUM(y) BY z.
315 GRAPH /BAR = MINIMUM(y) BY z.
317 GRAPH /BAR = MEAN(y) BY z BY y.
318 GRAPH /BAR = SUM(y) BY z BY y.
319 GRAPH /BAR = MAXIMUM(y) BY z BY y.
320 GRAPH /BAR = MINIMUM(y) BY z BY y.
323 AT_CHECK([pspp -o pspp.pdf barchart.sps], [0], [ignore])
324 dnl Ignore output -- this is just a no-crash check.
332 AT_SETUP([GRAPH buggy syntax])
334 AT_DATA([barchart.sps], [dnl
335 data list notable list /x y z*.
342 GRAPH /BAR = MINIMUM({) BY z BY y.
345 AT_CHECK([pspp -o pspp.pdf barchart.sps], [1], [ignore])
346 dnl Ignore output -- this is just a no-crash check.