Date: Wed, 21 Sep 2005 13:19:25 -0500
Reply-To: Vishal Dave <VishalDave@Affina.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Vishal Dave <VishalDave@Affina.com>
Subject: Re: Create denominator from Frequencies
Content-Type: text/plain; charset="US-ASCII"
Arthur,
You can use AGGREGATE COMMAND for creating frequency variable. If you
want frequency variable in the same data then you don't need to generate
another data file but if you want aggregated data with frequency
variable then you need to generate another data file. Below is the
sample code :
***************************************************
DATA LIST LIST /country.
BEGIN DATA
1
1
1
1
1
1
1
1
1
1
2
2
2
2
3
3
END DATA.
SORT CASES BY country .
*Use this if you want frequency variable in same data file
AGGREGATE
/OUTFILE=*
MODE=ADDVARIABLES
/PRESORTED
/BREAK=country
/Frequency=N.
*Use this if you want frequency variable in aggregated data file
AGGREGATE
/OUTFILE='C:\TEMP\temp.sav'
/PRESORTED
/BREAK=country
/Frequency=N.
GET
FILE='C:\TEMP\temp.sav'.
LIST.
************************************************************************
Hope this helps,
Vishal.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Arthur Aguirre
Sent: Wednesday, September 21, 2005 12:20 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Create denominator from Frequencies
Hi group,
Say I have these data.
DATA LIST LIST /country.
BEGIN DATA
1
1
1
1
1
1
1
1
1
1
2
2
2
2
3
3
END DATA.
freq/var = country .
How can I create a variable equal to the frequency of variable country?
I would like to use this variable (frequency count) as the denominator
in a calculation.
Denominator should be 10, 4, 2 for country 1, 2, 3, respectively.
Thanks.
Arthur
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________