Date: Wed, 7 Jul 1999 14:58:12 +0200
Reply-To: Joan Fernandez Ballart <jdfb@ASTOR.URV.ES>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Joan Fernandez Ballart <jdfb@ASTOR.URV.ES>
Subject: Create new variables
Content-Type: text/plain; charset="iso-8859-1"
I have two original variables, V1 (F5.0) and V2 (F3.0) and about 50000
cases. I need to enlarge the matrix data with the following criteria:
1- Create as many new variables corresponding to the different values of V1
(approx. 700 different and non-consecutive values).
2- The name of the new variables must include a letter as a systematic part
plus the value of V1.
3- The values of the new variables must be equal to the values of V2.
This can be done by way of "conventional" syntax as:
if (v1 = 1) a1 = v2.
if (v1 = 23) a23 = v2.
if (v1 = 5436) a5436 = v2.
….
but is tedious. Perhaps the macro and/or loops facilities can solve the
problem in a more elegant way, but the manuals don't explain how to do it
very well.
Can somebody help me and/or suggests any bibliographic reference?
Very many thanks in advance
Joan