Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: recoding "long" variable to text

From   Maarten buis <>
Subject   Re: st: recoding "long" variable to text
Date   Sun, 6 May 2007 22:37:39 +0100 (BST)

--- Marcos Feldman <> wrote:

> can anyone help me figure this out? i am trying to create a new
> variable based on an existing variable containing zoning codes. i
> actually have two variables with the zoning codes, one is string
> format another is long format. the codes (values) in both look like
> this: 0001, 0004, 0072, 9001, etc. I want to replace these codes with
> their descriptors, e.g., convert 0001 to "single-family residential,"
> and so on. 
> thus far stata has not allowed me to recode either string or long
> variables into "text".
> for example, for the long variable "PRI_ZONE" i used the command, 
>     recode test ("0002"="MULTIFAMILY DUPLEX") ("0100"="SINGLE FAMILY
> RESIDENCE").... [many more such commands...]
> but the response was "unknown el MULTIFAMILY DUPLEX in rule"
> is recoding into text not allowed? have i just written the rules
> incorrectly? is there some other way to accomplish this
> transformation?

-decode- might help, see: -help decode-

Hope this helps,

Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434

+31 20 5986715

Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index