COUNT: Correct treatment of missing values.
[pspp] / tests / language / xforms / count.at
1 AT_BANNER([COUNT])
2
3 AT_SETUP([COUNT -- numeric data])
4 AT_DATA([count.sps], [dnl
5 DATA LIST LIST /x y.
6 BEGIN DATA.
7 1 2
8 2 3
9 4 5
10 2 2
11 5 6
12 7 2
13 . 2
14 END DATA.
15
16 MISSING VALUES x(7)/y(3).
17
18 COUNT c=x y (2)/d=x y(7)/e=x y(missing)/f=x y(sysmis).
19
20 FORMATS ALL(F1).
21
22 LIST.
23 ])
24 AT_CHECK([pspp -O format=csv count.sps], [0], [dnl
25 Table: Reading free-form data from INLINE.
26 Variable,Format
27 x,F8.0
28 y,F8.0
29
30 Table: Data List
31 x,y,c,d,e,f
32 1,2,1,0,0,0
33 2,3,1,0,1,0
34 4,5,0,0,0,0
35 2,2,2,0,0,0
36 5,6,0,0,0,0
37 7,2,1,1,1,0
38 .,2,1,0,1,1
39 ])
40 AT_CLEANUP
41
42 AT_SETUP([COUNT -- string data])
43 AT_DATA([count.sps], [dnl
44 TITLE 'Test COUNT transformation'.
45
46 DATA LIST /v1 to v2 1-4(a).
47 BEGIN DATA.
48 1234
49 321 
50 2 13
51 4121
52 1104
53 03 4
54 0193
55 END DATA.
56 COUNT c=v1 to v2('2',' 4','1').
57 LIST.
58 ])
59 AT_CHECK([pspp -O format=csv count.sps], [0], [dnl
60 Title: Test COUNT transformation
61
62 Table: Reading 1 record from INLINE.
63 Variable,Record,Columns,Format
64 v1,1,1-  2,A2
65 v2,1,3-  4,A2
66
67 Table: Data List
68 v1,v2,c
69 12,34,.00
70 32,1 ,1.00
71 2 ,13,1.00
72 41,21,.00
73 11,04,.00
74 03,4,1.00
75 01,93,.00
76 ])
77 AT_CLEANUP