Date: Sun, 6 Mar 2011 12:30:39 -0800
Reply-To: drfg2008 <kontakt@datest.de>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: drfg2008 <kontakt@datest.de>
Subject: Re: different values in a row
In-Reply-To: <1299434605801-3411613.post@n5.nabble.com>
Content-Type: text/plain; charset=us-ascii
Thanks everybody!
I understood the syntax best which david provided.
-> aggregate. I should have known.
Thank you.
Here the complete syntax (with 4 variables computed randomly) in case
someone needs it.
input program.
loop a =1 to 100 by 1.
end case.
end loop.
end file.
end input program.
exe.
comp v1 =RV.BINOM(5,0.5).
comp v2 =RV.BINOM(5,0.5).
comp v3 =RV.BINOM(5,0.5).
comp v4 =RV.BINOM(5,0.5).
EXECUTE .
*say the file has variables V1 TO V4.
COMPUTE RowID=$CASENUM.
SAVE OUTFILE "C:\\differentValues.sav".
VECTOR V=V1 TO V4.
LOOP #=1 TO 4.
COMPUTE Var=V(#).
XSAVE OUTFILE "temp.sav" / KEEP RowID Var.
END LOOP.
EXE.
GET FILE "temp.sav".
AGGREGATE OUTFILE * / BREAK RowID Var /N=N.
AGGREGATE OUTFILE * / BREAK RowID /Unique=N.
MATCH FILES / FILE "C:\\differentValues.sav" / FILE * / BY RowID.
EXECUTE .
-----
FUB
--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/different-values-in-a-row-tp3411280p3411728.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.
=====================
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