674bd6ff05eb339ac2032f1b52fa60d6aeb52735
[pspp] / tests / language / dictionary / split-file.at
1 dnl PSPP - a program for statistical analysis.
2 dnl Copyright (C) 2017 Free Software Foundation, Inc.
3 dnl
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.
8 dnl
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.
13 dnl
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/>.
16 dnl
17 AT_BANNER([SPLIT FILE])
18
19 AT_SETUP([SPLIT FILE - basic test])
20 AT_DATA([split-file.sps], [dnl
21 title 'Test SPLIT FILE utility'.
22
23 data list notable /X 1 Y 2.
24 begin data.
25 12
26 16
27 17
28 19
29 15
30 14
31 27
32 20
33 26
34 25
35 28
36 29
37 24
38 end data.
39 split file by x.
40 list.
41 ])
42 AT_CHECK([pspp -o pspp.csv split-file.sps])
43 AT_CHECK([cat pspp.csv], [0], [dnl
44 Table: Split Values
45 Variable,Value
46 X,1
47
48 Table: Data List
49 X,Y
50 1,2
51 1,6
52 1,7
53 1,9
54 1,5
55 1,4
56
57 Table: Split Values
58 Variable,Value
59 X,2
60
61 Table: Data List
62 X,Y
63 2,7
64 2,0
65 2,6
66 2,5
67 2,8
68 2,9
69 2,4
70 ])
71 AT_CLEANUP
72
73
74
75
76
77 AT_SETUP([SPLIT FILE  - vs procedures])
78 AT_DATA([split-file.sps], [dnl
79
80 * This test is a compendium of those procedures which might
81 * have problems when run in conjunction with SPLITS.
82
83 data list list /a b c q g *.
84 begin data.
85 1 2 3     1  0
86 4 5 6     0  0
87 7 8 9     1  0
88 10 11 12  0  1
89 13 14 15  1  1
90 end data.
91
92 split file by g.
93
94
95 * The commented out lines are ones which currently fail.
96
97 AGGREGATE outfile='foo' /break=c /X=sum(a).
98 AUTORECODE variables = c into d .
99 COUNT e = c (1 2 3 4 5 6 7).
100 CROSSTABS a by b.
101 CORRELATIONS /VARIABLES = a b.
102 DELETE VARIABLES a.
103 DESCRIPTIVES e .
104 EXAMINE c by b.
105 EXPORT outfile='xxx'.
106 FACTOR /VARIABLES = b c d.
107 FILTER BY c.
108 FREQUENCIES b.
109 GLM c BY b.
110 GRAPH /HISTOGRAM = b .
111 GRAPH /SCATTERPLOT(BIVARIATE) = b with c by e .
112 GRAPH /BAR (GROUPED) = MEAN(b) by c by e.
113 GRAPH /BAR = COUNT BY  b.
114 LIST.
115 LOGISTIC REGRESSION q WITH b.
116 MEANS c b.
117 NPAR TESTS /MCNEMAR q.
118 ONEWAY c BY b.
119 QUICK CLUSTER b c.
120 RANK b c.
121 REGRESSION /VARIABLES = c /DEPENDENT = q.
122 RELIABILITY /VARIABLES = c b d.
123 RENAME VARIABLES (b = bb).
124 ROC bb by q(1).
125 SAMPLE 0.9 .
126 SAVE outfile='xx.sav'.
127 SORT CASES by bb.
128 T-TEST /GROUP=q(0,1) /VARIABLES=bb.
129 USE ALL.
130 FLIP /VARIABLES = bb, c .
131
132 execute.
133 finish.
134 ])
135
136 AT_CHECK([pspp -O format=csv split-file.sps], [0],[ignore])
137
138 AT_CLEANUP