dnl PSPP - a program for statistical analysis.
dnl Copyright (C) 2017 Free Software Foundation, Inc.
-dnl
+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
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
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
DATA LIST LIST NOTABLE /x (f8).
BEGIN DATA.
-1
-0
-1
-2
-2
-4
-5
+0
+1
+2
+2
+4
+5
END DATA.
RANK x.
END DATA.
RANK a b (D)
- /PRINT=YES
+ /PRINT=YES
/RANK
/TIES=HIGH
/RFRACTION
b,Nb,N
Table: Variables
-Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
-a,1,,Scale,Input,8,Right,F8.2,F8.2,
-b,2,,Scale,Input,8,Right,F8.2,F8.2,
-Ra,3,RANK of a,Scale,Input,8,Right,F9.3,F9.3,
-RFR001,4,RFRACTION of a,Scale,Input,8,Right,F6.4,F6.4,
-count,5,N of a,Scale,Input,8,Right,F6.0,F6.0,
-Rb,6,RANK of b,Scale,Input,8,Right,F9.3,F9.3,
-RFR002,7,RFRACTION of b,Scale,Input,8,Right,F6.4,F6.4,
-Nb,8,N of b,Scale,Input,8,Right,F6.0,F6.0,
+Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
+a,1,,Scale,Input,8,Right,F8.2,F8.2
+b,2,,Scale,Input,8,Right,F8.2,F8.2
+Ra,3,RANK of a,Scale,Input,8,Right,F9.3,F9.3
+RFR001,4,RFRACTION of a,Scale,Input,8,Right,F6.4,F6.4
+count,5,N of a,Scale,Input,8,Right,F6.0,F6.0
+Rb,6,RANK of b,Scale,Input,8,Right,F9.3,F9.3
+RFR002,7,RFRACTION of b,Scale,Input,8,Right,F6.4,F6.4
+Nb,8,N of b,Scale,Input,8,Right,F6.0,F6.0
Table: Data List
a,b,Ra,RFR001,count,Rb,RFR002,Nb
5 29
6 1
7 43
-8 8
+8 8
9 45
END DATA.
AT_CLEANUP
# Also tests small ranks for special case of SAVAGE ranks.
-AT_SETUP([RANK with fractional ranks])
+AT_SETUP([RANK with fractional ranks])
AT_DATA([rank.sps], [dnl
DATA LIST LIST NOTABLE /a * w * .
BEGIN DATA.
WEIGHT BY w.
-RANK a
+RANK a
/FRACTION=TUKEY
/PROPORTION
/SAVAGE
foo,RAN001,RANK
Table: Variables
-Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format,Missing Values
-foo,1,,Scale,Input,8,Right,F8.2,F8.2,
-rfoo,2,,Scale,Input,8,Right,F8.2,F8.2,
-ran003,3,,Scale,Input,8,Right,F8.2,F8.2,
-RAN001,4,RANK of foo,Scale,Input,8,Right,F9.3,F9.3,
+Name,Position,Label,Measurement Level,Role,Width,Alignment,Print Format,Write Format
+foo,1,,Scale,Input,8,Right,F8.2,F8.2
+rfoo,2,,Scale,Input,8,Right,F8.2,F8.2
+ran003,3,,Scale,Input,8,Right,F8.2,F8.2
+RAN001,4,RANK of foo,Scale,Input,8,Right,F9.3,F9.3
])
AT_CLEANUP
END DATA.
* invalid NTILES (no parameter)
-RANK x
+RANK x
/NTILES
.
* invalid NTILES (not an integer)
-RANK x
+RANK x
/NTILES(d)
.
* destination variable already exists
-RANK x
+RANK x
/RANK INTO x.
* Too many variables in INTO
-RANK x
+RANK x
/RANK INTO foo bar wiz.
])
AT_CHECK([pspp -O format=csv rank.sps], [1], [dnl