[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: HELP! recoding string or long variable into some "text" format
The first line of the Description in the help for -recode- says
"-recode- changes the values of numeric variables according to the
So, -recode- does not apply to string variables (which you are
Otherwise, I don't understand your question. It seems that
your data have two variables with values like
"0001" "single-family residential"
In which case what do you want to do?
It may be that you have different information in different
files, in which case you need to tell us more.
Also, for the Stata meaning of "format", see the help on -format-.
> 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"
> recoding into text not allowed? have i just written the rules
> incorrectly? is there some other way to accomplish this
* For searches and help try: