Statalist The Stata Listserver


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

Re: st: RE: Data management


From   "Richard Williams" <[email protected]>
To   [email protected]
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:  [email protected]
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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index