Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Data management


From   "Richard Williams" <Richard.A.Williams.5@ND.Edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: Data management
Date   Sat, 24 Mar 2007 23:44:26 -0400

Suryadipta asked:

b. Then I am trying to replace these id-s with
replace id=3 if id==1;
replace id=5 if id==2;
replace id=8 if id==3;

But the 3rd line of the command is replacing the first set
of id-s also. I would greatly appreciate if someone can
suggest how to take care of this.

*********************************
A couple of possibilities:

1.  Just reverse the order in which you are giving the commands

2.  Use the recode command, e.g.

recode id (1=3)(2=5)(3=8)

See -help recode-

[NOTE: Notre Dame's email server is acting up so I am trying gmail.
Hopefully I am not doing something horrible like sending html to the
list! ]
-------------------------------------------
Richard Williams, Notre Dame Dept of Sociology
OFFICE: (574)631-6668, (574)631-6463
HOME:   (574)289-5227
EMAIL:  Richard.A.Williams.5@ND.Edu
WWW:    http://www.nd.edu/~rwilliam
*
*   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