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 (October 2002)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 23 Oct 2002 08:52:56 +0200
Reply-To:     fvillamayor-research@ferrergrupo.com
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Frederic Villamayor <fvillamayor-research@ferrergrupo.com>
Subject:      Re: Recode Variable
Content-Type: text/plain; charset="iso-8859-1"

Another way to do it:

DATA LIST LIST /VARA. BEGIN DATA 1 1 1 1 2 2 2 2 3 3 3 END DATA.

SORT CASES BY vara (A). COMPUTE caso = $CASENUM. RANK VARIABLES=caso (A) BY vara /RANK INTO varb /PRINT=YES /TIES=MEAN . MATCH FILES /FILE = * /DROP caso. EXECUTE.

Frederic Villamayor Departamento de Toxicología C.I.D.F. GRUPO FERRER

Mark Casazza <Mark.Casazza@domino1.cuny.edu> Enviado por: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> 22.10.02 17:54 Por favor, responda a Mark Casazza

Para: SPSSX-L@LISTSERV.UGA.EDU cc: Asunto: Re: Recode Variable

This does it.

-- data list list /vara varb. begin data 1 1 1 2 1 3 1 4 2 1 2 2 2 3 2 4 3 1 3 2 3 3 end data.

sort cases by vara. compute varc = 1. if vara = lag(vara) varc = lag(varc) + 1. list. --

Mark V. Casazza Director of Academic Information The City University of New York 555 W. 57th St. Suite 1240 New York, NY 10019

phone: 212.541.0396 fax: 212.541.0392 email: Mark.Casazza@mail.cuny.edu

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of M½rcio Machado Ribeiro Sent: Tuesday, October 22, 2002 11:11 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Recode Varible

Hi listers,

Does anybody knows how do I recode a variable (A) to a different variable (B), doing the following procedure:

Variable A Variable B 1 1 1 2 1 3 1 4 2 1 2 2 2 3 2 4 3 1 3 2 3 3

I mean, I want to create a sequence of the variable B according to variable A. I will probably have to use a syntax procedure, right? Is it possible to create a new variable by a syntax procedure, when I already have the database.

Thanks in advance,

M½rcio Ribeiro

Get a speedy connection with MSN Broadband. Join now! Click Here


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