Date: Thu, 7 Dec 2000 19:41:40 -0500
Reply-To: Raynald Levesque <rlevesque@VIDEOTRON.CA>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Raynald Levesque <rlevesque@VIDEOTRON.CA>
Subject: Re: Labels
In-Reply-To: <000601c0604a$1b0a9a60$34021eac@generali.com.ar>
Content-Type: text/plain; charset="iso-8859-1"
Hi!
This is an automatic way to do it:
* To apply the string values of lab1as value labels to variable var1.
* define some sample data.
DATA LIST LIST /var1(F8) lab1(A8).
BEGIN DATA.
1 one
1 one
2 two
3 three
3 three
END DATA.
LIST.
SAVE OUTFILE='test1.sav'.
* need first to keep only cases with unique value labels.
AGGREGATE
/OUTFILE=*
/BREAK=var1
/lab1 = FIRST(lab1) .
STRING quot(A1).
COMPUTE quot="'".
STRING lab2(A10).
COMPUTE lab2=CONCAT(quot,lab1,quot).
* write a syntax file to assign the value labels.
WRITE OUTFILE 'temp.sps' /"ADD VALUE LABELS var1 " var1 " " lab2 ".".
EXE.
* Load the original data file and define the value labels.
GET FILE='test1.sav'.
INCLUDE 'temp.sps'.
HTH
Raynald Levesque rlevesque@videotron.ca
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of
> Paolo Orifici
> Sent: Thursday, December 07, 2000 7:35 AM
> To: SPSSX-L@LISTSERV.UGA.EDU
> Subject: Labels
>
>
> HI list members,
>
> I have a database with two variables, one is numeric
> (varnum) and the other
> is a string (varlabel) describing in a text the numeric variable. I'm
> looking for a way to apply to the numeric variable the text in the string
> variable as a label. Is it there a strightforward way to do this
> apart from
> autorecoding the string variable.
>
>
> varnum varlabel
> 5 green
> 15 black
> 43 red
> 6 white
> 8 blu
>
>
> Regards,
>
> Paolo Orifici