File: split-file.at

package info (click to toggle)
pspp 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 66,676 kB
  • sloc: ansic: 267,210; xml: 18,446; sh: 5,534; python: 2,881; makefile: 125; perl: 64
file content (221 lines) | stat: -rw-r--r-- 4,224 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
dnl PSPP - a program for statistical analysis.
dnl Copyright (C) 2017 Free Software Foundation, Inc.
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 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 You should have received a copy of the GNU General Public License
dnl along with this program.  If not, see <http://www.gnu.org/licenses/>.
dnl
AT_BANNER([SPLIT FILE])

AT_SETUP([SPLIT FILE - basic test])
AT_DATA([split-file.sps], [dnl
title 'Test SPLIT FILE utility'.

data list notable /X 1 Y 2.
begin data.
12
16
17
19
15
14
27
20
26
25
28
29
24
end data.
split file by x.
list.
])
AT_CHECK([pspp -o pspp.csv split-file.sps])
AT_CHECK([cat pspp.csv], [0], [dnl
Table: Split Values
Variable,Value
X,1

Table: Data List
X,Y
1,2
1,6
1,7
1,9
1,5
1,4

Table: Split Values
Variable,Value
X,2

Table: Data List
X,Y
2,7
2,0
2,6
2,5
2,8
2,9
2,4
])
AT_CLEANUP

AT_SETUP([SPLIT FILE  - vs procedures])
AT_DATA([split-file.sps], [dnl

* This test is a compendium of those procedures which might
* have problems when run in conjunction with SPLITS.

data list list /a b c q g *.
begin data.
1 2 3     1  0
4 5 6     0  0
7 8 9     1  0
10 11 12  0  1
13 14 15  1  1
end data.

split file by g.


* The commented out lines are ones which currently fail.

AGGREGATE outfile='foo' /break=c /X=sum(a).
AUTORECODE variables = c into d .
COUNT e = c (1 2 3 4 5 6 7).
CROSSTABS a by b.
CORRELATIONS /VARIABLES = a b.
DELETE VARIABLES a.
DESCRIPTIVES e .
EXAMINE c by b.
EXPORT outfile='xxx'.
FACTOR /VARIABLES = b c d.
FILTER BY c.
FREQUENCIES b.
GLM c BY b.
GRAPH /HISTOGRAM = b .
GRAPH /SCATTERPLOT(BIVARIATE) = b with c by e .
*GRAPH /BAR (GROUPED) = MEAN(b) by c by e.
GRAPH /BAR = COUNT BY  b.
LIST.
LOGISTIC REGRESSION q WITH b.
MEANS c b.
NPAR TESTS /MCNEMAR q.
ONEWAY c BY b.
QUICK CLUSTER b c.
RANK b c.
REGRESSION /VARIABLES = c /DEPENDENT = q.
RELIABILITY /VARIABLES = c b d.
RENAME VARIABLES (b = bb).
ROC bb by q(1).
SAMPLE 0.9 .
SAVE outfile='xx.sav'.
SORT CASES by bb.
T-TEST /GROUP=q(0,1) /VARIABLES=bb.
USE ALL.
FLIP /VARIABLES = bb, c .

execute.
finish.
])

AT_CHECK([pspp -O format=csv split-file.sps], [0],[ignore])

AT_CLEANUP

AT_SETUP([SPLIT FILE - split variable limit])
AT_DATA([split-file.sps], [dnl
DATA LIST LIST NOTABLE /V1 TO V9.
SPLIT FILE BY V1 TO V9.
])
AT_CHECK([pspp split-file.sps], [1], [dnl
split-file.sps:2.15-2.22: error: SPLIT FILE: At most 8 split variables may be
specified.
    2 | SPLIT FILE BY V1 TO V9.
      |               ^~~~~~~~
])
AT_CLEANUP

AT_SETUP([SPLIT FILE - SHOW SPLIT and SPLIT FILE OFF])
AT_DATA([show.sps], [dnl
SET PRINTBACK=ON.

SHOW SPLIT.

DATA LIST LIST NOTABLE/x y z.
SPLIT FILE BY x y.
SHOW SPLIT.

SPLIT FILE LAYERED BY y z.
SHOW SPLIT.

SPLIT FILE SEPARATE BY x z.
SHOW SPLIT.

SPLIT FILE OFF.
SHOW SPLIT.
])
AT_CHECK([pspp show.sps -O box=unicode], [0], [dnl
SET PRINTBACK=ON.


SHOW SPLIT.

  Settings
╭─────┬────╮
│SPLIT│none│
╰─────┴────╯


DATA LIST LIST NOTABLE/x y z.

SPLIT FILE BY x y.

SHOW SPLIT.

       Settings
╭─────┬──────────────╮
│SPLIT│x, y (LAYERED)│
╰─────┴──────────────╯


SPLIT FILE LAYERED BY y z.

SHOW SPLIT.

       Settings
╭─────┬──────────────╮
│SPLIT│y, z (LAYERED)│
╰─────┴──────────────╯


SPLIT FILE SEPARATE BY x z.

SHOW SPLIT.

        Settings
╭─────┬───────────────╮
│SPLIT│x, z (SEPARATE)│
╰─────┴───────────────╯


SPLIT FILE OFF.

SHOW SPLIT.

  Settings
╭─────┬────╮
│SPLIT│none│
╰─────┴────╯
])
AT_CLEANUP