Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: RE: RE: AW: recoding a variable


From   "Lachenbruch, Peter" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: RE: RE: AW: recoding a variable
Date   Thu, 18 Feb 2010 11:27:00 -0800

I knew if I set down cool people I'd miss someone.  Richard Williams, and Patrick Royston are obvious, so is Conroy.  My apologies to all I have missed.  

Tony

Peter A. Lachenbruch
Department of Public Health
Oregon State University
Corvallis, OR 97330
Phone: 541-737-3832
FAX: 541-737-4001


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Nick Cox
Sent: Thursday, February 18, 2010 9:59 AM
To: [email protected]
Subject: st: RE: RE: AW: recoding a variable

See also (very distinguished Stata users) Douglas Altman and Patrick
Royston at 
http://www.bmj.com/cgi/content/extract/332/7549/1080

Nick 
[email protected] 

Lachenbruch, Peter

A small comment: (Martin did cover this in his later post)
Be wary of replacing a variable you are recoding.  It's usually better
to maintain the original data - you never know when someone will ask you
for a dichotomy cutting at 0.75, etc.  Also, my comment from a few days
ago about why do this still holds.  You lose information.

Martin Weiss

replace var=var>.5

Data Analytics Corp.

I got some very good quick advice on a looping question I asked 
earlier.  I have another question.  Suppose I have a variable with 
values that range between 0 ands 1.  I simply want to recode this so 
that any value greater than 0.5 becomes a 1, and 0 otherwise.  How do I 
do this?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index