LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 31 May 2003 13:11:42 -0400
Reply-To:   Raynald Levesque <rlevesque@videotron.ca>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Raynald Levesque <rlevesque@videotron.ca>
Subject:   Re: VECTOR SPSS
In-Reply-To:   <OF05B6D743.641A1F2C-ONC1256D36.00462356@bp.vnu.com>
Content-type:   text/plain; charset=US-ASCII

Hi

the following macro does it:

DATA LIST LIST /vorhand. BEGIN DATA 8 2 5 12 END DATA.

NUMERIC x1 TO x12 y1 TO y12. * variables are assumed to be consecutive. * (Reorder them if this is not the case).

*///////////////. DEFINE !test(nb=!TOKENS(1)) !DO !cnt=1 !TO !nb DO IF vorhand=!cnt+1. - RECODE x1 TO !CONCAT('x',!cnt) y1 TO !CONCAT('y',!cnt) (ELSE=0). END IF. !DOEND !ENDDEFINE. *///////////////.

SET MPRINT=yes. !test nb=12. EXECUTE.

Regards

Raynald Levesque rlevesque@videotron.ca Visit my SPSS Pages http://pages.infinit.net/rlevesqu/index.htm

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Xiaoqin Oezener-Wan Sent: May 30, 2003 8:50 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: VECTOR SPSS

Dear all,

I have a problem:

I have a variable 'vorhand', which value is between 2 and 12, if vorhand = 2, I want to compute x1 = 0 and y1=0. and if vorhand = 3, i want to compute x1 =0 and y1 =0 and x2 =0 and y2 =0, ... and if vorhand = 12 , i want to have

x1 =0 , y1 =0 and x2 =0 , y2 =0, ..... x11=0 , y11 =0.

How can i do it with SPSS syntax?

Thank you in advance!


Back to: Top of message | Previous page | Main SPSSX-L page