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/>.
17 AT_BANNER([variable display attributes])
19 AT_SETUP([variable display attribute commands])
20 AT_DATA([var-display.sps], [dnl
21 DATA LIST FREE /x y z.
22 VARIABLE ALIGNMENT x (LEFT)/y (RIGHT)/z (CENTER).
23 VARIABLE WIDTH x (10)/y (12)/z (14).
24 VARIABLE LEVEL x (SCALE)/y (ORDINAL)/z (NOMINAL).
25 VARIABLE ROLE /TARGET x /BOTH y /NONE z.
28 AT_CHECK([pspp -o pspp.csv var-display.sps])
29 AT_CHECK([cat pspp.csv], [0], [dnl
31 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
32 x,1,Scale,Output,10,Left,F8.2,F8.2
33 y,2,Ordinal,Both,12,Right,F8.2,F8.2
34 z,3,Nominal,None,14,Center,F8.2,F8.2
38 AT_SETUP([variable level inference and SCALEMIN])
39 AT_DATA([var-level.sps], [dnl
40 DATA LIST LIST NOTABLE /n1 to n3 s1 to s5.
42 * Nominal formats (copied from data that will default to scale).
45 FORMATS n4(WKDAY5) n5(MONTH5).
47 * Scale formats (copied from data that will default to nominal).
51 FORMATS s6(DOLLAR6.2) s7(CCA8.2) s8(DATETIME17).
57 * n1 has 10 unique small values -> nominal.
58 * n2 has 23 unique small values -> nominal.
59 * n3 is all missing -> nominal.
60 * s1 has 24 unique small values -> scale.
61 * s2 has one negative value -> scale.
62 * s3 has one non-integer value -> scale.
63 * s4 has no valid values less than 10 -> scale.
64 * s5 has no valid values less than 10,000 -> scale.
75 10 10 . 10 10 10.5 19 110000
76 1 11 . 11 -1 1 11 10001
77 2 12 . 12 2 2 12 10002
78 3 13 . 13 3 3 13 10003
79 4 14 . 14 4 4 14 10004
80 5 15 . 15 5 5 15 10005
81 6 16 . 16 6 6 16 10006
82 7 17 . 17 7 7 17 10007
83 8 18 . 18 8 8 18 10008
84 9 19 . 19 9 9 19 10009
85 1 20 . 20 1 1 20 10001
86 2 21 . 21 2 2 21 10002
87 3 22 . 22 3 3 22 10003
88 4 23 . 23 4 4 23 10004
89 5 23 . 24 5 5 24 10005
90 6 23 . 24 6 6 25 10006
94 AT_CHECK([pspp -o pspp.csv var-level.sps])
95 AT_CHECK([cat pspp.csv], [0], [dnl
97 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
98 n1,1,Unknown,Input,8,Right,F8.2,F8.2
99 n2,2,Unknown,Input,8,Right,F8.2,F8.2
100 n3,3,Unknown,Input,8,Right,F8.2,F8.2
101 s1,4,Unknown,Input,8,Right,F8.2,F8.2
102 s2,5,Unknown,Input,8,Right,F8.2,F8.2
103 s3,6,Unknown,Input,8,Right,F8.2,F8.2
104 s4,7,Unknown,Input,8,Right,F8.2,F8.2
105 s5,8,Unknown,Input,8,Right,F8.2,F8.2
106 n4,9,Unknown,Input,8,Right,WKDAY5,WKDAY5
107 n5,10,Unknown,Input,8,Right,MONTH5,MONTH5
108 s6,11,Unknown,Input,8,Right,DOLLAR6.2,DOLLAR6.2
109 s7,12,Unknown,Input,8,Right,CCA8.2,CCA8.2
110 s8,13,Unknown,Input,8,Right,DATETIME17.0,DATETIME17.0
111 string,14,Nominal,Input,8,Left,A8,A8
114 Name,Position,Measurement Level,Role,Width,Alignment,Print Format,Write Format
115 n1,1,Nominal,Input,8,Right,F8.2,F8.2
116 n2,2,Nominal,Input,8,Right,F8.2,F8.2
117 n3,3,Nominal,Input,8,Right,F8.2,F8.2
118 s1,4,Scale,Input,8,Right,F8.2,F8.2
119 s2,5,Scale,Input,8,Right,F8.2,F8.2
120 s3,6,Scale,Input,8,Right,F8.2,F8.2
121 s4,7,Scale,Input,8,Right,F8.2,F8.2
122 s5,8,Scale,Input,8,Right,F8.2,F8.2
123 n4,9,Nominal,Input,8,Right,WKDAY5,WKDAY5
124 n5,10,Nominal,Input,8,Right,MONTH5,MONTH5
125 s6,11,Scale,Input,8,Right,DOLLAR6.2,DOLLAR6.2
126 s7,12,Scale,Input,8,Right,CCA8.2,CCA8.2
127 s8,13,Scale,Input,8,Right,DATETIME17.0,DATETIME17.0
128 string,14,Nominal,Input,8,Left,A8,A8
132 AT_BANNER([VARIABLE LABELS])
134 AT_SETUP([variable labels])
136 dnl The following test is to make sure the TVARS command works and that
137 dnl variables are displayed accordingly.
138 AT_DATA([var-labels.sps], [dnl
139 DATA LIST LIST NOTABLE /x * y *.
147 * While no labels have been set, the TVARS is irrelevant.
157 VARIABLE LABEL x 'foo' y 'bar'.
159 * Now, the TVARS setting should have effect
171 AT_CHECK([pspp -o pspp.csv -o pspp.txt var-labels.sps])
172 AT_CHECK([cat pspp.csv], [0],[dnl
173 Table: Descriptive Statistics
174 ,N,Mean,Std Dev,Minimum,Maximum
175 x,4,2.50,1.29,1.00,4.00
176 y,4,250.00,129.10,100.00,400.00
177 Valid N (listwise),4,,,,
178 Missing N (listwise),0,,,,
180 Table: Descriptive Statistics
181 ,N,Mean,Std Dev,Minimum,Maximum
182 x,4,2.50,1.29,1.00,4.00
183 y,4,250.00,129.10,100.00,400.00
184 Valid N (listwise),4,,,,
185 Missing N (listwise),0,,,,
187 Table: Descriptive Statistics
188 ,N,Mean,Std Dev,Minimum,Maximum
189 x,4,2.50,1.29,1.00,4.00
190 y,4,250.00,129.10,100.00,400.00
191 Valid N (listwise),4,,,,
192 Missing N (listwise),0,,,,
194 Table: Descriptive Statistics
195 ,N,Mean,Std Dev,Minimum,Maximum
196 x,4,2.50,1.29,1.00,4.00
197 y,4,250.00,129.10,100.00,400.00
198 Valid N (listwise),4,,,,
199 Missing N (listwise),0,,,,
201 Table: Descriptive Statistics
202 ,N,Mean,Std Dev,Minimum,Maximum
203 foo,4,2.50,1.29,1.00,4.00
204 bar,4,250.00,129.10,100.00,400.00
205 Valid N (listwise),4,,,,
206 Missing N (listwise),0,,,,
208 Table: Descriptive Statistics
209 ,N,Mean,Std Dev,Minimum,Maximum
210 x foo,4,2.50,1.29,1.00,4.00
211 y bar,4,250.00,129.10,100.00,400.00
212 Valid N (listwise),4,,,,
213 Missing N (listwise),0,,,,