Statalist The Stata Listserver


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

Re: st: -generate- and run time contingencies


From   "Michael Blasnik" <[email protected]>
To   <[email protected]>
Subject   Re: st: -generate- and run time contingencies
Date   Mon, 30 Jan 2006 12:08:54 -0500

"Nick Winter" <[email protected]> wrote
I am reminded again that it would be nice if the -replace- command somehow left behind the number of changes it makes (which it displays, but does not leave for a program to pick up.) It's been discussed before on statalist I think, and making -replace- r-class would likely break all kinds of programs, but still it would be handy to be able to get to that somehow....
I have also suggested this feature, although not by making -replace- into r-class, but perhaps making it s-class, or place the number of values changed in c(), or even in a global macro (remember $S_...?).

Although I think most problems, such as the original example given in this thread, have better solutions than looping repeatedly until a condition changes, there are some problems that still seem to require it. The addition of the itrim() function (thanks!) solved my most common need for such looping, but there are still some cases where loops are required, and could execute a bit faster, if you didn't have to add in a count command. It just seems very un-Stataish to have a value show up in the results window and have no direct way to access it.

Michael Blasnik

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