i want to place some categories like OTHER or DON'T KNOW always to the end of custom tables in SPSS. At the same time I sort them.
Doesn't matter whether it'll be syntaxis or something else. Found using weights but it doesn't satisfy me. Any recommendations? Thanks. |
The CTABLES CATEGORIES subcommand can specify
a specific category order. If you want to move some particular categories
to the end but don't want to list all the others, you can write it like
this.
/CATEGORIES VARIABLES=jobcat [OTHERNM 1]. That just moves category 1 to the end of the list. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Agatha <[hidden email]> To: [hidden email], Date: 11/14/2013 07:33 AM Subject: [SPSSX-L] how to fix the category OTHER to the end of custom tables while sorting? SPSS Sent by: "SPSSX(r) Discussion" <[hidden email]> i want to place some categories like OTHER or DON'T KNOW always to the end of custom tables in SPSS. At the same time I sort them. Doesn't matter whether it'll be syntaxis or something else. Found using weights but it doesn't satisfy me. Any recommendations? Thanks. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-fix-the-category-OTHER-to-the-end-of-custom-tables-while-sorting-SPSS-tp5723058.html Sent from the SPSSX Discussion mailing list archive at 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 |
Comments. I want it to look like that:
pink 50 green 40 blue 30 red 10 other 35 NOT like that: pink 50 green 40 other 35 blue 30 red 10 What exactly should I do? Still using /CATEGORIES VARIABLES=jobcat [OTHERNM 1] ??? |
List the actual value for the other category
last in the CATEGORIES subcommand, e.g.,
/CATEGORIES VARIABLES=jobcat [OTHERNM "other"] If you are trying to combine moving the other category with sorting, you cannot do that directly with CTABLES, but you can use the STATS CATEGORY ORDER extension command available from the SPSS Community website (www.ibm.com/developerworks/spssdevcentral) to construct a macro that can do this that you can use in the CATEGORIES value list. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Agatha <[hidden email]> To: [hidden email], Date: 11/15/2013 06:59 AM Subject: Re: [SPSSX-L] how to fix the category OTHER to the end of custom tables while sorting? SPSS Sent by: "SPSSX(r) Discussion" <[hidden email]> Comments. I want it to look like that: pink 50 green 40 blue 30 red 10 other 35 NOT like that: pink 50 green 40 other 35 blue 30 red 10 What exactly should I do? Still using /CATEGORIES VARIABLES=jobcat [OTHERNM 1] ??? -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-fix-the-category-OTHER-to-the-end-of-custom-tables-while-sorting-SPSS-tp5723058p5723088.html Sent from the SPSSX Discussion mailing list archive at 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 |
I can't sort them by frequences. Here what I have:
1 variable myEducation. 1 - Primary schools 2 - Secondary schools 3 - Alternative 4 - High school 9 - Don't answer the other - mySex male and female. the code: CTABLES /VLABELS VARIABLES=myEducation mySex DISPLAY=LABEL /TABLE myEducation [COUNT F40.0] BY mySex /CATEGORIES VARIABLES=myEducation [OTHERNM, 9]. STATS CATEGORY ORDER ITEMS = myEducation PREFIX=reorder SPECIALVALUES = 9 SPECIALVARS = myEducation OTHER=YES /OPTIONS ORDER=D CATEGORYLABELS=COUNTEDVALUES MISSING = EXCLUDE. The results: Male Female Primary schools 118 187 Secondary schools 2630 3049 Alternative 1105 1334 High school 4685 6239 Don't answer 104 146 !reorder_myEducation 4.0 2.0 3.0 1.0 9.0 I want it to be: Male Female High school 4685 6239 Secondary schools 2630 3049 Alternative 1105 1334 Primary schools 118 187 Don't answer 104 146 how?) |
use recode to make new variable with other = -1
best diana Sent from my iPhone > On 19 Nov 2013, at 11:15 pm, "Agatha" <[hidden email]> wrote: > > I can't sort them by frequences. Here what I have: > > 1 variable myEducation. > > 1 - Primary schools > 2 - Secondary schools > 3 - Alternative > 4 - High school > 9 - Don't answer > > > the other - mySex > > male and female. > > the code: > > CTABLES > /VLABELS VARIABLES=myEducation mySex DISPLAY=LABEL > /TABLE myEducation [COUNT F40.0] BY mySex > /CATEGORIES VARIABLES=myEducation [OTHERNM, 9]. > > > STATS CATEGORY ORDER ITEMS = myEducation PREFIX=reorder > SPECIALVALUES = 9 > SPECIALVARS = myEducation OTHER=YES > /OPTIONS ORDER=D CATEGORYLABELS=COUNTEDVALUES MISSING = EXCLUDE. > > The results: > Male Female > > Primary schools 118 187 > Secondary schools 2630 3049 > Alternative 1105 1334 > High school 4685 6239 > Don't answer 104 146 > > !reorder_myEducation 4.0 2.0 3.0 1.0 9.0 > > > I want it to be: > Male Female > High school 4685 6239 > Secondary schools 2630 3049 > Alternative 1105 1334 > Primary schools 118 187 > Don't answer 104 146 > > > how?) > > > > > > -- > View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-fix-the-category-OTHER-to-the-end-of-custom-tables-while-sorting-SPSS-tp5723058p5723142.html > Sent from the SPSSX Discussion mailing list archive at 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 ===================== 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 Alina
Try using:
Missing values myeducation (9). . . before running ctables. I Looked at CROSSTABS, but there doesn't appear to be an option for descending values in that or in CTABLES, so another way, from the data editor: File > New > syntax . . then copy syntax below and Run > All Missing values myeducation (9). Recode myeducation (1=4)(2=3)(3=2)(4=1) into newed. Format newed (f2.0). Val lab newed 1 'High school' 2 'Secondary schools' 3 'Alternative' 4 'Primary schools' 9 "Don't answer". Crosstabs newed by sex /cel cou col. . . or just do all except the CROSSTABS line and then run CTABLES. John F Hall (Mr) [Retired academic survey researcher] Email: [hidden email] Website: www.surveyresearch.weebly.com SPSS start page: www.surveyresearch.weebly.com/spss-without-tears.html -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Agatha Sent: 19 November 2013 11:37 To: [hidden email] Subject: Re: how to fix the category OTHER to the end of custom tables while sorting? SPSS I can't sort them by frequences. Here what I have: 1 variable myEducation. 1 - Primary schools 2 - Secondary schools 3 - Alternative 4 - High school 9 - Don't answer the other - mySex male and female. the code: CTABLES /VLABELS VARIABLES=myEducation mySex DISPLAY=LABEL /TABLE myEducation [COUNT F40.0] BY mySex /CATEGORIES VARIABLES=myEducation [OTHERNM, 9]. STATS CATEGORY ORDER ITEMS = myEducation PREFIX=reorder SPECIALVALUES = 9 SPECIALVARS = myEducation OTHER=YES /OPTIONS ORDER=D CATEGORYLABELS=COUNTEDVALUES MISSING = EXCLUDE. The results: Male Female Primary schools 118 187 Secondary schools 2630 3049 Alternative 1105 1334 High school 4685 6239 Don't answer 104 146 !reorder_myEducation 4.0 2.0 3.0 1.0 9.0 I want it to be: Male Female High school 4685 6239 Secondary schools 2630 3049 Alternative 1105 1334 Primary schools 118 187 Don't answer 104 146 how?) -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-fix-the-category-OTHER- to-the-end-of-custom-tables-while-sorting-SPSS-tp5723058p5723142.html Sent from the SPSSX Discussion mailing list archive at 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 ===================== 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 Alina
You need to run STATS CATEGORY ORDER first
and then use the macro it generates in the category list in the CTABLES
CATEGORIES subcommand.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: Agatha <[hidden email]> To: [hidden email], Date: 11/19/2013 03:51 PM Subject: Re: [SPSSX-L] how to fix the category OTHER to the end of custom tables while sorting? SPSS Sent by: "SPSSX(r) Discussion" <[hidden email]> I can't sort them by frequences. Here what I have: 1 variable myEducation. 1 - Primary schools 2 - Secondary schools 3 - Alternative 4 - High school 9 - Don't answer the other - mySex male and female. the code: CTABLES /VLABELS VARIABLES=myEducation mySex DISPLAY=LABEL /TABLE myEducation [COUNT F40.0] BY mySex /CATEGORIES VARIABLES=myEducation [OTHERNM, 9]. STATS CATEGORY ORDER ITEMS = myEducation PREFIX=reorder SPECIALVALUES = 9 SPECIALVARS = myEducation OTHER=YES /OPTIONS ORDER=D CATEGORYLABELS=COUNTEDVALUES MISSING = EXCLUDE. The results: Male Female Primary schools 118 187 Secondary schools 2630 3049 Alternative 1105 1334 High school 4685 6239 Don't answer 104 146 !reorder_myEducation 4.0 2.0 3.0 1.0 9.0 I want it to be: Male Female High school 4685 6239 Secondary schools 2630 3049 Alternative 1105 1334 Primary schools 118 187 Don't answer 104 146 how?) -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/how-to-fix-the-category-OTHER-to-the-end-of-custom-tables-while-sorting-SPSS-tp5723058p5723142.html Sent from the SPSSX Discussion mailing list archive at 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 |
Free forum by Nabble | Edit this page |