[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Re: replace with many if conditions
--On Tuesday, September 10, 2002 2:33 -0400 Iwan wrote:
It is often better to deal with this 'replace with many if conditions' in a
different manner. There are a couple of FAQs that suggest how this might
better be done:
dyadic operators (return code 130). This is quite frustrating in large
data sets when, for example, using replace with many if conditions.
So to debug one hase to split command lines.
It's not a real problem, but did anyone else faced this constraint?
Do you know if there are plans at STATA to relax the constraint?
http://www.stata.com/support/faqs/data/selectid.html (see point #3)
In your case a way to do this would be to create a dataset containing the
values that trigger a replace, and the desired result values, and then
merge that on to your dataset. Then one replace command would do it (e.g.
the desired result would be missing where it is not indicated, so a replace
'if desired<.' would modify the original variable to the desired value for
only those cases where the match occurs.
This method is much more reliable than having very lengthy
replace/keep/drop statements, and is much more Stataish.
* For searches and help try: