Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: AW: -recode- question

From   "Grote, Veit Dr." <>
To   <>
Subject   st: AW: -recode- question
Date   Wed, 3 Dec 2003 09:07:40 +0100

If you look for - help progfun - you find the following. However, the rule seems not to be documented under the command - recode - in the manuals.
recode(x,x1,x2,...,xn) returns x if x is missing; returns missing if x1 = missing or x2= missing or ... xn-1 = missing; returns missing if x1, x2, ..., xn are not weakly increasing; returns x1 if x<=x1; returns x2 if x1<x<=x2; returns x3 if x2<x<=x3; ...; xn if x>x(n-1).  
Also see autocode() and irecode() for other styles of recode functions.

Veit Grote

-----Ursprüngliche Nachricht-----
Von: Friedrich Huebler []
Gesendet: Mittwoch, 3. Dezember 2003 03:33
Betreff: st: -recode- question

This question was inspired by Veit Grote's recent post. The command

. recode varname min/3=1 3/6=2 6/9=3

recodes all values <=3 to 1, and all values >3 and <=6 to 2. How does
a Stata user learn this "read from left to right" rule? I could not
find this documented anywhere.

Friedrich Huebler

Do you Yahoo!?
Free Pop-Up Blocker - Get it now
*   For searches and help try:

*   For searches and help try:

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