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

st: AW: -recode- question


From   "Grote, Veit Dr." <Veit.Grote@med.uni-muenchen.de>
To   <statalist@hsphsun2.harvard.edu>
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 [mailto:huebler@rocketmail.com]
Gesendet: Mittwoch, 3. Dezember 2003 03:33
An: statalist@hsphsun2.harvard.edu
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
http://companion.yahoo.com/
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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