Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: replace


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: replace
Date   Fri, 10 Dec 2004 13:32:32 -0000

I think this needs a little more explanation.

In your example, the difference between "text"
and "test" looks like a typo. If so, 

gen varnew = "test" + varold 

would be enough, but I doubt that's what you 
mean. 

Nick 
[email protected] 

Hans J. Baumgartner
 
> I would like to replace some values but the old values should be some 
> part of the new values
> 
> That is
> 
> VARold
> 1
> 2
> 3
> 
> should become
> 
> VARnew
> text1
> test2
> test3
> 
> 
> The trick is to be flexible, since I would like to use the 
> command in a 
> loop and hence the values of VARold may not be constant over 
> all loops.

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