Date: Fri, 15 Jun 2001 10:52:38 -0300
Reply-To: Hector Maletta <hmaletta@OVERNET.COM.AR>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Hector Maletta <hmaletta@OVERNET.COM.AR>
Subject: Re: save frequencies as a variable and huber-white estimator
Content-Type: text/plain; charset=us-ascii
Helena Sanabria wrote:
> - it's possible to save the frequencies from a variable as a new variable?
Yes, it's possible. You should use AGGREGATE to create variables that
represent the frequencies, then MATCH FILES to add them to you original
file. Example syntax:
GET FILE 'original.sav'.
SORT CASES BY your variable.
AGGREGATE OUTFILE 'frequencies.sav' /BREAK=your variable
/FREQVAR 'Frequencies of your variable'=NU.
MATCH FILES FILE=* /TABLE 'frequencies.sav'/BY your variable.
SAVE OUTFILE 'modified.sav'.
The aggregate command creates a new file with one case for each value of
your variable. The only variables in this file are your variable and its
frequencies. The match files command merges this aggregated file with
your original file, adding to each case the frequency of the particular
value of your variable shown by that case.
(replace 'your variable' by the name of your variable). This would do it
for one particular variable. For several, just repeat the procedure.
There must surely be ways to do it for several variables at once.
Hector Maletta
Universidad del Salvador
Buenos Aires, Argentina