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([ROC free distribution])
20 AT_DATA([roc.sps], [dnl
22 data list notable list /x * y * w * a *.
42 /print = se coordinates
43 /criteria = testpos(large) distribution(free) ci(99)
46 AT_CHECK([pspp -o pspp.csv roc.sps])
47 AT_CHECK([cat pspp.csv], [0], [dnl
54 Table: Area Under the Curve
55 Variable under test,Area,Std. Error,Asymptotic Sig.,Asymp. 99% Confidence Interval,
56 ,,,,Lower Bound,Upper Bound
57 x,.910,.030,.000,.839,.981
59 Table: Coordinates of the Curve
60 Test variable,Positive if greater than or equal to,Sensitivity,1 - Specificity
70 AT_SETUP([ROC negative exponential distribution])
71 AT_DATA([roc.sps], [dnl
73 data list notable list /x * y * w * a *.
92 /plot = curve(reference)
93 /print = se coordinates
94 /criteria = testpos(large) distribution(negexpo) ci(95)
97 AT_CHECK([pspp -o pspp.csv roc.sps])
98 AT_CHECK([cat pspp.csv], [0], [dnl
100 a,Valid N (listwise),
105 Table: Area Under the Curve
106 Variable under test,Area,Std. Error,Asymptotic Sig.,Asymp. 95% Confidence Interval,
107 ,,,,Lower Bound,Upper Bound
108 x,.910,.030,.000,.860,.960
109 y,.697,.052,.001,.611,.783
111 Table: Coordinates of the Curve
112 Test variable,Positive if greater than or equal to,Sensitivity,1 - Specificity
129 AT_SETUP([ROC with anomaly])
130 AT_DATA([roc.sps], [dnl
132 data list notable list /x * a * comment (a20).
149 22 0 "here is the anomaly"
169 AT_CHECK([pspp -o pspp.csv -o pspp.txt roc.sps])
170 AT_CHECK([cat pspp.csv], [0], [dnl
172 a,Valid N (listwise),
177 Table: Area Under the Curve
178 Variable under test,Area,Std. Error,Asymptotic Sig.,Asymp. 95% Confidence Interval,
179 ,,,,Lower Bound,Upper Bound
180 x,.490,.111,.927,.307,.673
187 AT_SETUP([ROC crash on no state variable])
188 AT_DATA([roc.sps], [dnl
189 data list notable list /x * y * w * a *.
199 AT_CHECK([pspp -o pspp.csv roc.sps], [1], [ignore])
204 AT_SETUP([ROC crash on invalid syntax])
205 AT_DATA([roc.sps], [dnl
206 data list notable list /x * y * a *.
217 AT_CHECK([pspp -O format=csv roc.sps], [1], [ignore])
221 AT_SETUP([ROC syntax errors])
222 AT_DATA([roc.sps], [dnl
223 DATA LIST LIST NOTABLE/x y z.
230 ROC x BY y(5)/MISSING=**.
231 ROC x BY y(5)/PLOT=CURVE(**).
232 ROC x BY y(5)/PLOT=CURVE(REFERENCE **).
233 ROC x BY y(5)/PLOT=**.
234 ROC x BY y(5)/PRINT=**.
235 ROC x BY y(5)/CRITERIA=CUTOFF **.
236 ROC x BY y(5)/CRITERIA=CUTOFF(**).
237 ROC x BY y(5)/CRITERIA=CUTOFF(INCLUDE **).
238 ROC x BY y(5)/CRITERIA=TESTPOS **.
239 ROC x BY y(5)/CRITERIA=TESTPOS(**).
240 ROC x BY y(5)/CRITERIA=TESTPOS(LARGE **).
241 ROC x BY y(5)/CRITERIA=CI **.
242 ROC x BY y(5)/CRITERIA=CI(**).
243 ROC x BY y(5)/CRITERIA=CI(5 **).
244 ROC x BY y(5)/CRITERIA=DISTRIBUTION **.
245 ROC x BY y(5)/CRITERIA=DISTRIBUTION(**).
246 ROC x BY y(5)/CRITERIA=DISTRIBUTION(FREE **).
247 ROC x BY y(5)/CRITERIA=**.
250 AT_CHECK([pspp -O format=csv roc.sps], [1], [dnl
251 "roc.sps:2.5-2.6: error: ROC: Syntax error expecting variable name.
255 "roc.sps:3.7-3.8: error: ROC: Syntax error expecting `BY'.
259 "roc.sps:4.10-4.11: error: ROC: Syntax error expecting variable name.
263 "roc.sps:5.12-5.13: error: ROC: Syntax error expecting `('.
267 "roc.sps:6.12-6.13: error: ROC: Syntax error expecting number.
271 "roc.sps:7.14-7.15: error: ROC: Syntax error expecting `)'.
272 7 | ROC x BY y(5 **).
275 "roc.sps:8.23-8.24: error: ROC: Syntax error expecting INCLUDE or EXCLUDE.
276 8 | ROC x BY y(5)/MISSING=**.
279 "roc.sps:9.26-9.27: error: ROC: Syntax error expecting REFERENCE.
280 9 | ROC x BY y(5)/PLOT=CURVE(**).
283 "roc.sps:10.36-10.37: error: ROC: Syntax error expecting `@:}@'.
284 10 | ROC x BY y(5)/PLOT=CURVE(REFERENCE **).
287 "roc.sps:11.20-11.21: error: ROC: Syntax error expecting CURVE or NONE.
288 11 | ROC x BY y(5)/PLOT=**.
291 "roc.sps:12.21-12.22: error: ROC: Syntax error expecting SE or COORDINATES.
292 12 | ROC x BY y(5)/PRINT=**.
295 "roc.sps:13.31-13.32: error: ROC: Syntax error expecting `('.
296 13 | ROC x BY y(5)/CRITERIA=CUTOFF **.
299 "roc.sps:14.31-14.32: error: ROC: Syntax error expecting INCLUDE or EXCLUDE.
300 14 | ROC x BY y(5)/CRITERIA=CUTOFF(**).
303 "roc.sps:15.39-15.40: error: ROC: Syntax error expecting `)'.
304 15 | ROC x BY y(5)/CRITERIA=CUTOFF(INCLUDE **).
307 "roc.sps:16.32-16.33: error: ROC: Syntax error expecting `('.
308 16 | ROC x BY y(5)/CRITERIA=TESTPOS **.
311 "roc.sps:17.32-17.33: error: ROC: Syntax error expecting LARGE or SMALL.
312 17 | ROC x BY y(5)/CRITERIA=TESTPOS(**).
315 "roc.sps:18.38-18.39: error: ROC: Syntax error expecting `)'.
316 18 | ROC x BY y(5)/CRITERIA=TESTPOS(LARGE **).
319 "roc.sps:19.27-19.28: error: ROC: Syntax error expecting `('.
320 19 | ROC x BY y(5)/CRITERIA=CI **.
323 "roc.sps:20.27-20.28: error: ROC: Syntax error expecting number.
324 20 | ROC x BY y(5)/CRITERIA=CI(**).
327 "roc.sps:21.29-21.30: error: ROC: Syntax error expecting `)'.
328 21 | ROC x BY y(5)/CRITERIA=CI(5 **).
331 "roc.sps:22.37-22.38: error: ROC: Syntax error expecting `('.
332 22 | ROC x BY y(5)/CRITERIA=DISTRIBUTION **.
335 "roc.sps:23.37-23.38: error: ROC: Syntax error expecting FREE or NEGEXPO.
336 23 | ROC x BY y(5)/CRITERIA=DISTRIBUTION(**).
339 "roc.sps:24.42-24.43: error: ROC: Syntax error expecting `)'.
340 24 | ROC x BY y(5)/CRITERIA=DISTRIBUTION(FREE **).
343 "roc.sps:25.24-25.25: error: ROC: Syntax error expecting CUTOFF, TESTPOS, CI, or DISTRIBUTION.
344 25 | ROC x BY y(5)/CRITERIA=**.
347 "roc.sps:26.16-26.17: error: ROC: Syntax error expecting MISSING, PLOT, PRINT, or CRITERIA.
348 26 | ROC x BY y(5)/ **.