cumulative frequencies

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

cumulative frequencies

Christoph Oeldorf
Dear SPSS users,

I need help in answering the following question:

Is there a command or a function with the cumulative
frequencies can be calculated and transferred into a table?
Thanks for the help.

Best regards,
Christoph Oeldorf

--
Christoph Oeldorf
Abteilung Anwendungen

Tel. (06221) 54-4405
[hidden email]

Ruprecht-Karls-Universität Heidelberg
Universitätsrechenzentrum (URZ)
Im Neuenheimer Feld 293, 69120 Heidelberg http://www.urz.uni-heidelberg.de
D

=====================
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: cumulative frequencies

Bruce Weaver
Administrator
You could use OMS (Output Management System) to send the output from FREQUENCIES to a dataset.  In that dataset,

do (if $casenum EQ 1).
-  compute cf = frequency.
else.
-  compute cf = lag(cf) + frequency.
end if.
exe.

Then use SUMMARIZE or REPORT, for example, to generate a table.


Christoph Oeldorf wrote
Dear SPSS users,

I need help in answering the following question:

Is there a command or a function with the cumulative
frequencies can be calculated and transferred into a table?
Thanks for the help.

Best regards,
Christoph Oeldorf

--
Christoph Oeldorf
Abteilung Anwendungen

Tel. (06221) 54-4405
Oeldorf@urz.uni-heidelberg.de

Ruprecht-Karls-Universität Heidelberg
Universitätsrechenzentrum (URZ)
Im Neuenheimer Feld 293, 69120 Heidelberg http://www.urz.uni-heidelberg.de
D

=====================
To manage your subscription to SPSSX-L, send a message to
LISTSERV@LISTSERV.UGA.EDU (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/).
Reply | Threaded
Open this post in threaded view
|

Re: cumulative frequencies

John F Hall
In reply to this post by Christoph Oeldorf
Not clear what exactly you want, or why, but open a new syntax file and try:
 
freq <varlist> .
 
...in which you supply one or more variable names in <varlist> and then copy the last column.
----- Original Message -----
Sent: Tuesday, July 13, 2010 1:45 PM
Subject: cumulative frequencies


Dear SPSS users,

I need help in answering the following question:

Is there a command or a function with the cumulative
frequencies can be calculated and transferred into a table?
Thanks for the help.

Best regards,
Christoph Oeldorf

--
Christoph Oeldorf
Abteilung Anwendungen

Tel. (06221) 54-4405
[hidden email]

Ruprecht-Karls-Universität Heidelberg
Universitätsrechenzentrum (URZ)
Im Neuenheimer Feld 293, 69120 Heidelberg http://www.urz.uni-heidelberg.de
D

=====================
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: cumulative frequencies

Art Kendall
In reply to this post by Christoph Oeldorf
  Is this what you are looking for?

GET
   FILE='C:\Program
Files\SPSSInc\PASWStatistics18\Samples\English\world95.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
FREQUENCIES VARIABLES=region
   /ORDER=ANALYSIS.
sort cases by region.
DATASET DECLARE aggfile.
aggregate outfile= aggfile /break= region
  /kount = n.
dataset activate aggfile.
numeric cumfreq (f10).
leave cumfreq.
compute cumfreq = cumfreq + kount.
execute.

Art Kendall
Social Research Consultants

On 7/13/2010 7:45 AM, Christoph Oeldorf wrote:

> Dear SPSS users,
>
> I need help in answering the following question:
>
> Is there a command or a function with the cumulative
> frequencies can be calculated and transferred into a table?
> Thanks for the help.
>
> Best regards,
> Christoph Oeldorf
>
> --
> Christoph Oeldorf
> Abteilung Anwendungen
>
> Tel. (06221) 54-4405
> [hidden email]
>
> Ruprecht-Karls-Universität Heidelberg
> Universitätsrechenzentrum (URZ)
> Im Neuenheimer Feld 293, 69120 Heidelberg
> http://www.urz.uni-heidelberg.de
> D
>
> =====================
> 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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: cumulative frequencies

Bruce Weaver
Administrator
I forgot about LEAVE.  That's much nicer than the method I posted.  Thanks for the reminder, Art.  

Here's another way I just found in a sample file I stashed away some time ago.  With the AGGFILE dataset active:

create cumfreq2 = csum (kount).
exe.

This gives the same result as Art's method.



Art Kendall wrote
  Is this what you are looking for?

GET
   FILE='C:\Program
Files\SPSSInc\PASWStatistics18\Samples\English\world95.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
FREQUENCIES VARIABLES=region
   /ORDER=ANALYSIS.
sort cases by region.
DATASET DECLARE aggfile.
aggregate outfile= aggfile /break= region
  /kount = n.
dataset activate aggfile.
numeric cumfreq (f10).
leave cumfreq.
compute cumfreq = cumfreq + kount.
execute.

Art Kendall
Social Research Consultants

On 7/13/2010 7:45 AM, Christoph Oeldorf wrote:
> Dear SPSS users,
>
> I need help in answering the following question:
>
> Is there a command or a function with the cumulative
> frequencies can be calculated and transferred into a table?
> Thanks for the help.
>
> Best regards,
> Christoph Oeldorf
>
> --
> Christoph Oeldorf
> Abteilung Anwendungen
>
> Tel. (06221) 54-4405
> Oeldorf@urz.uni-heidelberg.de
>
> Ruprecht-Karls-Universität Heidelberg
> Universitätsrechenzentrum (URZ)
> Im Neuenheimer Feld 293, 69120 Heidelberg
> http://www.urz.uni-heidelberg.de
> D
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> LISTSERV@LISTSERV.UGA.EDU (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
LISTSERV@LISTSERV.UGA.EDU (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/).
Reply | Threaded
Open this post in threaded view
|

Re: cumulative frequencies

Art Kendall
I thought there was such a function as csum but looked it up as "cusum" and did not find it.

More than one way to do many things in SPSS,

Art

On 7/13/2010 2:29 PM, Bruce Weaver wrote:
I forgot about LEAVE.  That's much nicer than the method I posted.  Thanks
for the reminder, Art.

Here's another way I just found in a sample file I stashed away some time
ago.  With the AGGFILE dataset active:

create cumfreq2 = csum (kount).
exe.

This gives the same result as Art's method.




Art Kendall wrote:
  Is this what you are looking for?

GET
   FILE='C:\Program
Files\SPSSInc\PASWStatistics18\Samples\English\world95.sav'.
DATASET NAME DataSet1 WINDOW=FRONT.
FREQUENCIES VARIABLES=region
   /ORDER=ANALYSIS.
sort cases by region.
DATASET DECLARE aggfile.
aggregate outfile= aggfile /break= region
  /kount = n.
dataset activate aggfile.
numeric cumfreq (f10).
leave cumfreq.
compute cumfreq = cumfreq + kount.
execute.

Art Kendall
Social Research Consultants

On 7/13/2010 7:45 AM, Christoph Oeldorf wrote:
Dear SPSS users,

I need help in answering the following question:

Is there a command or a function with the cumulative
frequencies can be calculated and transferred into a table?
Thanks for the help.

Best regards,
Christoph Oeldorf

--
Christoph Oeldorf
Abteilung Anwendungen

Tel. (06221) 54-4405
[hidden email]

Ruprecht-Karls-Universität Heidelberg
Universitätsrechenzentrum (URZ)
Im Neuenheimer Feld 293, 69120 Heidelberg
http://www.urz.uni-heidelberg.de
D

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



-----
--
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.
--
View this message in context: http://old.nabble.com/cumulative-frequencies-tp29149427p29154077.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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: cumulative frequencies

Christoph Oeldorf
In reply to this post by Christoph Oeldorf
Dear Listers,

thank you for help.

We found our solution. We use:

SORT CASES  BY Year.
SPLIT FILE SEPARATE BY Year
create cumfreq2 = csum (day).
Execute.

Best regards,
Christoph Oeldorf

--
Christoph Oeldorf
Abteilung Anwendungen

Tel. (06221) 54-4405
[hidden email]

Ruprecht-Karls-Universität Heidelberg
Universitätsrechenzentrum (URZ)
Im Neuenheimer Feld 293, 69120 Heidelberg http://www.urz.uni-heidelberg.de

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