|
Hi,
I have a long list of hospital admission indications. With custom tables I can list the percentages of each indication for each centre ranking from the highest percentages to the lowest. Is it possible with syntax to get not the whole list but only the 10 indications with the highest percentages, a top ten of indications. Thanks, Leo Bakker ===================== 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 |
|
Hi Leo,
It is a bit tricky but I hope you can follow this example: * Open a file (find where you have the SPSS example files on your computer). GET FILE='C:\Program Files\SPSS14\GSS93 subset.sav' /keep id agewed. DATASET NAME agewed WINDOW=FRONT. * Our task will be to tabelate the top 10 ages of wedding. * Aggregate the ages, and then compute ranks (you can use the RANK procedure, or this easy way). DATASET DECLARE aggr. AGGREGATE /OUTFILE='aggr' /BREAK=agewed /N_BREAK=N. DATASET ACTIVATE aggr. SORT CASES BY N_BREAK (D) agewed (A) . compute rank = $casenum. SORT CASES BY agewed (A) . * Add ranks to the original dataset. DATASET ACTIVATE agewed . SORT CASES BY agewed (A) . MATCH FILES /FILE=* /TABLE='aggr' /BY agewed /DROP= N_BREAK . SORT CASES BY id (A) . * And now select or recode the cases according to the ranks and tabelate. * I use TEMPORARY command, it makes the syntax easier to understand; it is also possible to create derived variables or to use FILTER. temp. do if rank > 10. - recode agewed (else = 97). end if. add val lab agewed 97 'Other'. freq agewed . Hope this helps Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Leo Bakker Sent: Tuesday, June 24, 2008 6:34 PM To: [hidden email] Subject: top 10 Hi, I have a long list of hospital admission indications. With custom tables I can list the percentages of each indication for each centre ranking from the highest percentages to the lowest. Is it possible with syntax to get not the whole list but only the 10 indications with the highest percentages, a top ten of indications. Thanks, Leo Bakker ===================== 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 _____________ Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem. Jste si jisti, že opravdu potřebujete vytisknout tuto zprávu a/nebo její přílohy? Myslete na přírodu. This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission. Are you sure that you really need a print version of this message and/or its attachments? Think about nature. -.- -- ===================== 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 |
