I have a variable "Gross earnings from paid work" coded in 11 to 20 groups for each year in which it is used. The coding scheme used was changed twice, so the earnings intervals are not the same for each year. In some years the variable [REarn] is not used: [REarnQ] "Earnings quartile group" is used instead. For years when [REarnQ] is not calculated I can get an approximation by recoding [REarn] ~ ~ INTO [REarnQ] but I'd like to estimate a mean/median for actual gross earnings for each category of [REarn] by something like: DO IF (year = 1983) . RECODE (<value(s)> = 1) (<value(s)> = 2) etc (else = copy) INTO newrearn. ELSE IF (year = 1984) etc. ~ ~ ~ ELSE IF (year = 2015) ~ ~ ~ END IF. However, I would like to take account of the distribution of earnings for each year. For the centre of the distribution I can take a mid-point, but what should I do about the intervals further away from the centre, especially the outer ends "Under £x" and "£x or more"? Oh, and variable [year] is not present for every year, so that has had to be inserted manually. Sorry if there's too much detail below, but it gives a clearer idea of the problem. Thanks in advance for any suggestions. 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)
[NB: No £ sign in 1983]
|
Can't you use RANK and its options to get quartiles by year,
regardless of the units for that year?
--
Rich Ulrich
From: SPSSX(r) Discussion <[hidden email]> on behalf of John F Hall <[hidden email]>
Sent: Saturday, October 13, 2018 4:18 AM To: [hidden email] Subject: Estimating actual earnings from earnings groups I have a variable "Gross earnings from paid work" coded in 11 to 20 groups for each year in which it is used. The coding scheme used was changed twice, so the earnings intervals are not the same for each year.
In some years the variable [REarn] is not used: [REarnQ] "Earnings quartile group" is used instead. For years when [REarnQ] is not calculated I can get an approximation by recoding [REarn] ~ ~ INTO [REarnQ] but I'd like to estimate a mean/median for actual gross earnings for each category of [REarn] by something like:
DO IF (year = 1983) . RECODE (<value(s)> = 1) (<value(s)> = 2) etc (else = copy) INTO newrearn. ELSE IF (year = 1984) etc. ~ ~ ~ ELSE IF (year = 2015) ~ ~ ~ END IF.
However, I would like to take account of the distribution of earnings for each year. For the centre of the distribution I can take a mid-point, but what should I do about the intervals further away from the centre, especially the outer ends "Under £x" and "£x or more"?
Oh, and variable [year] is not present for every year, so that has had to be inserted manually.
Sorry if there's too much detail below, but it gives a clearer idea of the problem.
Thanks in advance for any suggestions.
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)
[NB: No £ sign in 1983]
|
Rich Thanks for the suggestion. Tried that on the cumulative file: RANK variables = rearn /ntiles (4) into xrearnq . CRO year by newrearnq.
It's done the same for all years. Got round that with: SPLIT FILE by year. RANK variables = rearn /ntiles (4) into newrearnq . SPLIT FILE off. CRO year by newrearnq /cel row.
Quartile points calculated within years. Exactly what I wanted. Just got to slot in existing [rearnq] for years 2011 – 2014.
*Check. CRO rearnq by newrearnq.
CORR rearnq xrearnq 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) From: SPSSX(r) Discussion <[hidden email]> On Behalf Of Rich Ulrich Can't you use RANK and its options to get quartiles by year, regardless of the units for that year? -- Rich Ulrich From: SPSSX(r) Discussion <[hidden email]> on behalf of John F Hall <[hidden email]> I have a variable "Gross earnings from paid work" coded in 11 to 20 groups for each year in which it is used. The coding scheme used was changed twice, so the earnings intervals are not the same for each year. In some years the variable [REarn] is not used: [REarnQ] "Earnings quartile group" is used instead. For years when [REarnQ] is not calculated I can get an approximation by recoding [REarn] ~ ~ INTO [REarnQ] but I'd like to estimate a mean/median for actual gross earnings for each category of [REarn] by something like: DO IF (year = 1983) . RECODE (<value(s)> = 1) (<value(s)> = 2) etc (else = copy) INTO newrearn. ELSE IF (year = 1984) etc. ~ ~ ~ ELSE IF (year = 2015) ~ ~ ~ END IF. However, I would like to take account of the distribution of earnings for each year. For the centre of the distribution I can take a mid-point, but what should I do about the intervals further away from the centre, especially the outer ends "Under £x" and "£x or more"? Oh, and variable [year] is not present for every year, so that has had to be inserted manually. Sorry if there's too much detail below, but it gives a clearer idea of the problem. Thanks in advance for any suggestions. 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)
[NB: No £ sign in 1983]
===================== 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 |
In reply to this post by John F Hall
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 |
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 .
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----- 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 |
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 .
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-----
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 |
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 .
rank VARIABLES= rearn (a) /ntiles (4) into xxxx by year .
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 .
cro year by xxxx /cel row,.
So try: SPLIT FILE by year. rank VARIABLES= rearn (a) /ntiles (4) into xxxx .
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.
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 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]> 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 .
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----- 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 |
Administrator
|
Try this, John:
RANK VARIABLES = rearn (a) BY year /ntiles (4). John F Hall wrote > 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 . > > --- snip --- ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- Sent from: http://spssx-discussion.1045642.n5.nabble.com/ ===================== 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
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Free forum by Nabble | Edit this page |