Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: AW: recoding a variable


From   "Lachenbruch, Peter" <Peter.Lachenbruch@oregonstate.edu>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: AW: recoding a variable
Date   Thu, 18 Feb 2010 09:15:30 -0800

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.

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: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Martin Weiss
Sent: Thursday, February 18, 2010 4:53 AM
To: statalist@hsphsun2.harvard.edu
Subject: st: AW: recoding a variable


<> 



*************
replace var=var>.5
*************



HTH
Martin

-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Data Analytics
Corp.
Gesendet: Donnerstag, 18. Februar 2010 01:12
An: statalist@hsphsun2.harvard.edu
Betreff: st: recoding a variable

Hi,

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?

Thanks,

Walt



-- 
________________________

Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536
________________________
(V) 609-936-8999
(F) 609-936-3733
walt@dataanalyticscorp.com
www.dataanalyticscorp.com

*
*   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/

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index