Hi all,
I had an SPSS question which I haven’t solved after a couple of days, so I would really appreciate if someone could have a look at it and maybe give me some suggestions. In the custom table options I added a category to a table (Top-2),as you can see below, but the problem is that this added category is also calculated for the empty cells (even after unmarking the option “empty categories” within the “Categories and Totals” option. The data (from 8 to 21) are in the dataset defined as an dot (.). So would be great if you could help me with it. Thanks in advance! |
Hi Mustafa
I found a solution to show just the non-empty categories. I haven't found out how to get the percentage of the top-2. You may try using /PCOMPUTE for that or (really a ugly work-around) compute the percentage with an Aggregation (MODE=ADDVARIABLES) and display the percents as MAX values . I do not understand why the /PCOMPUTE var shows in all your empty categories. You may discuss that with SPSS. It may be a bug. Here the solution: NEw File. DATASET CLOSE All. GET FILE='D:\TEMP\Sample File.SAV'. DATASET NAME DataSet2 WINDOW=FRONT. VARSTOCASES /ID=id1 /MAKE trans1 FROM PIVariants_1_1 to PIVariants_21_1 /INDEX=Index1(21) /NULL=DROP. Do if Trans1 = 4 or Trans1 = 5. - Compute Top_2 = 1. End if. Exec. CTABLES /VLABELS VARIABLES=Index1 trans1 Top_2 DISPLAY=DEFAULT /TABLE Index1 [C] BY trans1 [C][ROWPCT.COUNT PCT8.1] + Top_2 [S] [COUNT F8.0, TOTALN F8.0, VALIDN F8.0, COLPCT.SUM PCT8.1] /CATEGORIES VARIABLES=Index1 ORDER=A KEY=VALUE EMPTY= EXCLUDE /CATEGORIES VARIABLES=trans1 ORDER=A KEY=VALUE EMPTY=EXCLUDE. * The work-around would look something like that (untested):. Sort case by Index1. If Missing(Top_2) Top_2 = 0. AGGREGATE /OUTFILE=* MODE=ADDVARIABLES /BREAK=Index1 /Top_2_pgt=PGT(Top_2 0). * then use the MAXIMUM of Top_2_pgt for your percentage (using the format PCT8.1) CTABLES /VLABELS VARIABLES=Index1 trans1 Top_2_pgt DISPLAY=DEFAULT /TABLE Index1 BY trans1 [ROWPCT.COUNT PCT8.1] + Top_2_pgt [COUNT F8.0, MAXIMUM PCT8.1] /CATEGORIES VARIABLES=Index1 ORDER=A KEY=VALUE EMPTY=EXCLUDE /CATEGORIES VARIABLES=trans1 ORDER=A KEY=VALUE EMPTY=INCLUDE. Hope this helps, Christian ********************************** la volta statistics Christian Schmidhauser, Dr.phil.II Weinbergstrasse 108 CH-8006 Zürich Tel: +41 (043) 233 98 01 Fax: +41 (043) 233 98 02 email: mailto:[hidden email] Web: www.lavolta.ch -----Ursprüngliche Nachricht----- Von: SPSSX(r) Discussion [mailto:[hidden email]] Im Auftrag von MustafaB Gesendet: Montag, 14. März 2011 22:16 An: [hidden email] Betreff: Deleting empty rows in Custom Tables (SPSS 19) Hi all, I had an SPSS question which I havent solved after a couple of days, so I would really appreciate if someone could have a look at it and maybe give me some suggestions. In the custom table options I added a category to a table (Top-2),as you can see below, but the problem is that this added category is also calculated for the empty cells (even after unmarking the option empty categories within the Categories and Totals option. The data (from 8 to 21) are in the dataset defined as an dot (.). So would be great if you could help me with it. Thanks in advance! http://spssx-discussion.1045642.n5.nabble.com/file/n3614982/1.png -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Deleting-empty-rows-in-Custom- Tables-SPSS-19-tp3614982p3614982.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 |
Free forum by Nabble | Edit this page |