Looks as though DM's suggestion about keyword BY is the culprit.
I tried three variations, but none of them worked.
Here's one of them:
rank VARIABLES = rearn (a) /ntiles (4) into xxxx by year .
Warnings |
RANK syntax error. This is not a valid variable name. It either exceeds 64 characters, does not start with a letter, contains something besides letters, digits, "_", or ".", or is a reserved word. |
Execution of this command stops. |
The number of variable names in the INTO variable list exceeds the number of variable names in the input variable list. |
rank VARIABLES= rearn (a) /ntiles (4) into xxxx by year .
Warnings |
RANK syntax error. This is not a valid variable name. It either exceeds 64 characters, does not start with a letter, contains something besides letters, digits, "_", or ".", or is a reserved word. |
Execution of this command stops. |
The number of variable names in the INTO variable list exceeds the number of variable names in the input variable list. |
If I delete "by year" here's one that works, but it generates the same grouping for each year:
rank VARIABLES= rearn (a) /ntiles (4) into xxxx .
Created Variablesa | |||
Source Variable | Function | New Variable | Label |
REarnc | Percentile Groupb | xxxx | Percentile Group of REarn |
a. Mean rank of tied values is used for ties. | |||
b. 4 groups are generated. | |||
c. Ranks are in ascending order. |
cro year by xxxx /cel row,.
year Year of Interview * xxxx Percentile Group of REarn Crosstabulation | ||||||
% within year Year of Interview | ||||||
xxxx Percentile Group of REarn | Total | |||||
1 | 2 | 3 | 4 | |||
year Year of Interview | 1983 | 55.9% | 31.1% | 13.0% | 100.0% | |
1984 | 52.0% | 30.7% | 17.3% | 100.0% | ||
1985 | 47.8% | 30.9% | 21.3% | 100.0% | ||
1986 | 43.8% | 28.5% | 21.9% | 5.8% | 100.0% | |
1987 | 39.1% | 28.9% | 25.5% | 6.5% | 100.0% | |
1989 | 30.0% | 26.9% | 30.6% | 12.5% | 100.0% | |
1990 | 25.8% | 24.4% | 34.0% | 15.8% | 100.0% | |
1991 | 24.9% | 22.4% | 34.2% | 18.5% | 100.0% | |
1993 | 19.7% | 21.2% | 37.1% | 21.9% | 100.0% | |
1994 | 18.0% | 18.9% | 35.7% | 27.4% | 100.0% | |
1995 | 16.4% | 18.4% | 36.2% | 29.0% | 100.0% | |
1996 | 16.2% | 17.8% | 34.1% | 32.0% | 100.0% | |
1997 | 17.7% | 15.2% | 34.1% | 32.9% | 100.0% | |
1998 | 18.1% | 16.6% | 31.1% | 34.3% | 100.0% | |
1999 | 14.0% | 16.3% | 33.0% | 36.7% | 100.0% | |
2000 | 14.6% | 12.6% | 32.2% | 40.6% | 100.0% | |
2001 | 11.6% | 12.2% | 30.2% | 45.9% | 100.0% | |
2002 | 28.9% | 26.7% | 22.0% | 22.3% | 100.0% | |
2003 | 28.9% | 27.8% | 21.7% | 21.5% | 100.0% | |
2004 | 28.1% | 25.9% | 21.6% | 24.4% | 100.0% | |
2005 | 27.0% | 28.1% | 20.8% | 24.2% | 100.0% | |
2006 | 23.3% | 25.1% | 23.4% | 28.2% | 100.0% | |
2007 | 25.1% | 24.7% | 22.0% | 28.2% | 100.0% | |
2008 | 22.6% | 23.2% | 22.9% | 31.3% | 100.0% | |
2009 | 23.4% | 24.5% | 22.6% | 29.5% | 100.0% | |
2010 | 24.4% | 17.4% | 17.6% | 40.6% | 100.0% | |
2015 | 20.5% | 13.7% | 16.0% | 49.8% | 100.0% | |
Total | 25.4% | 22.6% | 26.4% | 25.5% | 100.0% |
So try:
SPLIT FILE by year.
rank VARIABLES= rearn (a) /ntiles (4) into xxxx .
Warnings |
An already existing variable name was used in the INTO variable list. |
Execution of this command stops. |
Oops!
Either
Highlight the row in the Data Editor:
xxxx Ordinal Percentile Group of REarn None None 0 Numeric 3 6 Right Input
Right click >> Clear
Or
DELETE VARIABLES xxxx.
Here's the one that generates separate groupings for each year:
SPLIT FILE by year.
rank VARIABLES= rearn (a) /ntiles (4) into xxxx .
SPLIT FILE off.
cro year by xxxx /cel row.
year Year of Interview * xxxx Percentile Group of REarn Crosstabulation | ||||||
% within year Year of Interview | ||||||
xxxx Percentile Group of REarn | Total | |||||
1 | 2 | 3 | 4 | |||
year Year of Interview | 1983 | 21.1% | 34.7% | 20.1% | 24.1% | 100.0% |
1984 | 26.1% | 25.9% | 19.8% | 28.2% | 100.0% | |
1985 | 26.8% | 21.0% | 30.9% | 21.3% | 100.0% | |
1986 | 24.4% | 27.5% | 20.3% | 27.8% | 100.0% | |
1987 | 29.3% | 20.1% | 29.3% | 21.3% | 100.0% | |
1989 | 22.6% | 22.6% | 35.1% | 19.6% | 100.0% | |
1990 | 25.8% | 24.4% | 24.3% | 25.5% | 100.0% | |
1991 | 24.9% | 22.4% | 24.3% | 28.3% | 100.0% | |
1993 | 29.6% | 23.9% | 24.6% | 21.9% | 100.0% | |
1994 | 27.2% | 21.0% | 24.4% | 27.4% | 100.0% | |
1995 | 25.8% | 20.5% | 31.0% | 22.6% | 100.0% | |
1996 | 25.2% | 19.3% | 29.7% | 25.8% | 100.0% | |
1997 | 26.0% | 18.9% | 29.3% | 25.8% | 100.0% | |
1998 | 26.1% | 29.6% | 16.5% | 27.8% | 100.0% | |
1999 | 22.3% | 30.0% | 24.0% | 23.8% | 100.0% | |
2000 | 27.2% | 22.6% | 22.9% | 27.3% | 100.0% | |
2001 | 23.8% | 30.2% | 21.8% | 24.1% | 100.0% | |
2002 | 21.2% | 29.0% | 27.5% | 22.3% | 100.0% | |
2003 | 28.9% | 21.2% | 23.0% | 26.9% | 100.0% | |
2004 | 28.1% | 19.8% | 27.7% | 24.4% | 100.0% | |
2005 | 27.0% | 21.7% | 27.2% | 24.2% | 100.0% | |
2006 | 23.3% | 25.1% | 28.8% | 22.8% | 100.0% | |
2007 | 25.1% | 24.7% | 27.1% | 23.1% | 100.0% | |
2008 | 22.6% | 23.2% | 28.3% | 25.9% | 100.0% | |
2009 | 23.4% | 24.5% | 27.6% | 24.5% | 100.0% | |
2010 | 24.4% | 22.9% | 27.2% | 25.6% | 100.0% | |
2015 | 25.2% | 25.1% | 26.7% | 23.1% | 100.0% | |
Total | 25.3% | 24.0% | 26.1% | 24.6% | 100.0% |
John F Hall MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]
Email: [hidden email]
Website: Journeys in Survey Research
Course: Survey Analysis Workshop (SPSS)
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Rich Ulrich
Sent: 15 October 2018 05:12
To: [hidden email]
Subject: Re: Estimating actual earnings from earnings groups
Your very first error message says that it objects to VARIABLES.
Your example that works has VARIABLES=
I'd say, apparently that "=" is required.
I'm not sure that's true for every command, but I never tested it.
--
Rich Ulrich
From: SPSSX(r) Discussion <[hidden email]> on behalf of John F Hall <[hidden email]>
Sent: Sunday, October 14, 2018 12:23 PM
To: [hidden email]
Subject: Re: Estimating actual earnings from earnings groups
Tried all manner of variations, but BY doesn't work for me.
rank VARIABLES rearn /ntiles (4) into xxxx by year .
rank VARIABLES rearn (a) /ntiles (4) into xxxx by year .
Warnings |
Text: VARIABLES Command: rank An undefined variable name, or a scratch or system variable was specified in a variable list which accepts only standard variables. Check spelling and verify the existence of this variable. Execution of this command stops. |
No analysis is performed because of an invalid input variable list. |
Expected A or D keyword on the VARIABLES subcommand was not found. Syntax checking begins with the next right parenthesis. |
The number of variable names in the INTO variable list exceeds the number of variable names in the input variable list. |
RANK syntax error. This is not a valid variable name. It either exceeds 64 characters, does not start with a letter, contains something besides letters, digits, "_", or ".", or is a reserved word. |
An already existing variable name was used in the INTO variable list. |
Not to worry, I got what I wanted with:
SPLIT FILE by year.
RANK variables = rearn /ntiles (4) into newrearnq .
John F Hall MA (Cantab) Dip Ed (Dunelm)
[Retired academic survey researcher]
Email: [hidden email]
Website: Journeys in Survey Research
Course: Survey Analysis Workshop (SPSS)
Research: Subjective Social Indicators (Quality of Life)
-----Original Message-----
From: SPSSX(r) Discussion <[hidden email]> On Behalf Of David Marso
Sent: 14 October 2018 17:31
To: [hidden email]
Subject: Re: Estimating actual earnings from earnings groups
Note that RANK has a BY subcommand.
=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Free forum by Nabble | Edit this page |