top 5 freqs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

top 5 freqs

Rodrigo Briceño
Dear SPSS co-listers.

I am handling a database with registries of patients being treated in
each of 6 hospitals. I want to produce a table with the top 5 causes of
diagnosis by each hospital. I was thinking on segmenting the database
and then produce a frequency table, but I need to drop diagnosis below
the 5th place. Another option I used was to generate a table with
diagnosis in rows and hospitals in columns, but for getting my table I
must sort and drop 6 times.
Do any of you know some syntax that do the job?

thanks.
--

__________________________________________________________________

*Rodrigo Briceño*
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
+506  22-32-08-30                  *Fax
*+506  88-86-11-77*                  Celular**
*[hidden email] <mailto:[hidden email]>
www.sanigest.com <http://www.sanigest.com/>

MSN: [hidden email] <mailto:[hidden email]>
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and
confidential. It is for the exclusive use of the address and
distribution, dissemination, copying or use by others is strictly
prohibited. If you have received this communication by error, please
delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial
para el uso exclusivo del destinatario. La distribución, diseminación,
copia u otro uso por terceras personas es estrictamente prohibida. Si
usted ha recibido esta comunicación por error, le rogamos borrar el
mensaje original y comunicárnoslo a esta misma dirección.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: top 5 freqs

Melissa Ives
If you have one variable that is diagnosis, you ask for the results sorted by frequency (/FORMAT=DFREQ) to get most frequent at the top.  Otherwise, you'll need to give better information about how your data are set up.

Melissa

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rodrigo Briceño
Sent: Tuesday, October 21, 2008 4:50 PM
To: [hidden email]
Subject: [SPSSX-L] top 5 freqs

Dear SPSS co-listers.

I am handling a database with registries of patients being treated in each of 6 hospitals. I want to produce a table with the top 5 causes of diagnosis by each hospital. I was thinking on segmenting the database and then produce a frequency table, but I need to drop diagnosis below the 5th place. Another option I used was to generate a table with diagnosis in rows and hospitals in columns, but for getting my table I must sort and drop 6 times.
Do any of you know some syntax that do the job?

thanks.
--

__________________________________________________________________

*Rodrigo Briceño*
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
+506  22-32-08-30                  *Fax
*+506  88-86-11-77*                  Celular**
*[hidden email] <mailto:[hidden email]> www.sanigest.com <http://www.sanigest.com/>

MSN: [hidden email] <mailto:[hidden email]>
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.

=====================
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

PRIVILEGED AND CONFIDENTIAL INFORMATION
This transmittal and any attachments may contain PRIVILEGED AND
CONFIDENTIAL information and is intended only for the use of the
addressee. If you are not the designated recipient, or an employee
or agent authorized to deliver such transmittals to the designated
recipient, you are hereby notified that any dissemination,
copying or publication of this transmittal is strictly prohibited. If
you have received this transmittal in error, please notify us
immediately by replying to the sender and delete this copy from your
system. You may also call us at (309) 827-6026 for assistance.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: top 5 freqs

Rodrigo Briceño
In attention to Melissa help, my DB is organized as:
h   dx
h1 dx1
h1 dx2
h1 dx1
h2 dx1

with 18,000 observations and two columns: h is for hospital name and dx
for name of the diagnosis. Each row is a patient treated on each
hospital. Using dfreq do the job, but I can't produce a table with just
the top 5 diagnosis by hospital.

__________________________________________________________________

*Rodrigo Briceño*
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
+506  22-32-08-30                  *Fax
*+506  88-86-11-77*                  Celular**
*[hidden email] <mailto:[hidden email]>
www.sanigest.com <http://www.sanigest.com/>

MSN: [hidden email] <mailto:[hidden email]>
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and
confidential. It is for the exclusive use of the address and
distribution, dissemination, copying or use by others is strictly
prohibited. If you have received this communication by error, please
delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial
para el uso exclusivo del destinatario. La distribución, diseminación,
copia u otro uso por terceras personas es estrictamente prohibida. Si
usted ha recibido esta comunicación por error, le rogamos borrar el
mensaje original y comunicárnoslo a esta misma dirección.



Melissa Ives wrote:

> If you have one variable that is diagnosis, you ask for the results sorted by frequency (/FORMAT=DFREQ) to get most frequent at the top.  Otherwise, you'll need to give better information about how your data are set up.
>
> Melissa
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rodrigo Briceño
> Sent: Tuesday, October 21, 2008 4:50 PM
> To: [hidden email]
> Subject: [SPSSX-L] top 5 freqs
>
> Dear SPSS co-listers.
>
> I am handling a database with registries of patients being treated in each of 6 hospitals. I want to produce a table with the top 5 causes of diagnosis by each hospital. I was thinking on segmenting the database and then produce a frequency table, but I need to drop diagnosis below the 5th place. Another option I used was to generate a table with diagnosis in rows and hospitals in columns, but for getting my table I must sort and drop 6 times.
> Do any of you know some syntax that do the job?
>
> thanks.
> --
>
> __________________________________________________________________
>
> *Rodrigo Briceño*
> Project Manager
> Sanigest Internacional
>
> +506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
> +506  22-32-08-30                  *Fax
> *+506  88-86-11-77*                  Celular**
> *[hidden email] <mailto:[hidden email]> www.sanigest.com <http://www.sanigest.com/>
>
> MSN: [hidden email] <mailto:[hidden email]>
> SKYPE: rbriceno1087
>
> _____________________
>
> This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.
>
>
> Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.
>
> =====================
> 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
>
> PRIVILEGED AND CONFIDENTIAL INFORMATION
> This transmittal and any attachments may contain PRIVILEGED AND
> CONFIDENTIAL information and is intended only for the use of the
> addressee. If you are not the designated recipient, or an employee
> or agent authorized to deliver such transmittals to the designated
> recipient, you are hereby notified that any dissemination,
> copying or publication of this transmittal is strictly prohibited. If
> you have received this transmittal in error, please notify us
> immediately by replying to the sender and delete this copy from your
> system. You may also call us at (309) 827-6026 for assistance.
>
>

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: top 5 freqs

Spousta Jan
Hi Rodrigo,

Try this:

* create fake data.
INPUT PROGRAM.
loop id = 1 to 18000.
- compute h = rnd(uniform(4) + 1).
- compute dx = rnd(normal(400) +800).
- end case.
end loop.
end file.
END INPUT PROGRAM.
exe.
form all (f4).

* begin of the solution.
AGGREGATE
  /OUTFILE=* MODE=replace
  /BREAK=h dx
  /N_BREAK=N.
SORT CASES BY h(A) N_BREAK(D) dx(A).
var lab N_BREAK "# of clients with the diagnosis".

do if $casenum = 1 or h ne lag(h).
- compute caserank = 1.
else.
- compute caserank = lag(caserank) + 1.
end if.

COMPUTE filter_$=(caserank <= 5).
VARIABLE LABEL filter_$ 'caserank <= 5 (FILTER)'.
VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.
FILTER BY filter_$.

SUMMARIZE
  /TABLES=dx N_BREAK BY h
  /FORMAT=VALIDLIST NOCASENUM TOTAL
  /TITLE='Case Summaries'
  /MISSING=VARIABLE
  /CELLS=COUNT.

Best regards,

Jan

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rodrigo Briceno
Sent: Wednesday, October 22, 2008 12:05 AM
To: [hidden email]
Subject: Re: top 5 freqs

In attention to Melissa help, my DB is organized as:
h   dx
h1 dx1
h1 dx2
h1 dx1
h2 dx1

with 18,000 observations and two columns: h is for hospital name and dx for name of the diagnosis. Each row is a patient treated on each hospital. Using dfreq do the job, but I can't produce a table with just the top 5 diagnosis by hospital.

__________________________________________________________________

*Rodrigo Briceño*
Project Manager
Sanigest Internacional

+506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
+506  22-32-08-30                  *Fax
*+506  88-86-11-77*                  Celular**
*[hidden email] <mailto:[hidden email]> www.sanigest.com <http://www.sanigest.com/>

MSN: [hidden email] <mailto:[hidden email]>
SKYPE: rbriceno1087

_____________________

This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.


Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.



Melissa Ives wrote:

> If you have one variable that is diagnosis, you ask for the results sorted by frequency (/FORMAT=DFREQ) to get most frequent at the top.  Otherwise, you'll need to give better information about how your data are set up.
>
> Melissa
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
> Of Rodrigo Briceño
> Sent: Tuesday, October 21, 2008 4:50 PM
> To: [hidden email]
> Subject: [SPSSX-L] top 5 freqs
>
> Dear SPSS co-listers.
>
> I am handling a database with registries of patients being treated in each of 6 hospitals. I want to produce a table with the top 5 causes of diagnosis by each hospital. I was thinking on segmenting the database and then produce a frequency table, but I need to drop diagnosis below the 5th place. Another option I used was to generate a table with diagnosis in rows and hospitals in columns, but for getting my table I must sort and drop 6 times.
> Do any of you know some syntax that do the job?
>
> thanks.
> --
>
> __________________________________________________________________
>
> *Rodrigo Briceño*
> Project Manager
> Sanigest Internacional
>
> +506  22-91-12-00 ext. 113  * Oficina* *Costa Rica*
> +506  22-32-08-30                  *Fax
> *+506  88-86-11-77*                  Celular**
> *[hidden email] <mailto:[hidden email]> www.sanigest.com
> <http://www.sanigest.com/>
>
> MSN: [hidden email] <mailto:[hidden email]>
> SKYPE: rbriceno1087
>
> _____________________
>
> This communication contains legal information which is privileged and confidential. It is for the exclusive use of the address and distribution, dissemination, copying or use by others is strictly prohibited. If you have received this communication by error, please delete the original message and e-mail us.
>
>
> Esta comunicación contiene información legal privilegiada y confidencial para el uso exclusivo del destinatario. La distribución, diseminación, copia u otro uso por terceras personas es estrictamente prohibida. Si usted ha recibido esta comunicación por error, le rogamos borrar el mensaje original y comunicárnoslo a esta misma dirección.
>
> =====================
> 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
>
> PRIVILEGED AND CONFIDENTIAL INFORMATION This transmittal and any
> attachments may contain PRIVILEGED AND CONFIDENTIAL information and is
> intended only for the use of the addressee. If you are not the
> designated recipient, or an employee or agent authorized to deliver
> such transmittals to the designated recipient, you are hereby notified
> that any dissemination, copying or publication of this transmittal is
> strictly prohibited. If you have received this transmittal in error,
> please notify us immediately by replying to the sender and delete this
> copy from your system. You may also call us at (309) 827-6026 for
> assistance.
>
>

=====================
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