Statalist The Stata Listserver

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

st: RE: RE: minimum of "all other variables"

From   Steve Vaisey <>
Subject   st: RE: RE: minimum of "all other variables"
Date   Tue, 17 Oct 2006 08:32:41 -0400


I knew it would be embarassingly easy. But at least its easy enough that I actually learned something this time! This gives me a couple new programming tools to mess around with. Thanks!

(And thanks to Svend for the early ideas. That also gives me some ideas for other new tricks.)


But this is faster, as it reduces the interpretive overhead of ploughing through -egen- repetitively. unab myvars : price-foreign qui foreach v of local myvars { local others : list myvars - v tokenize `others' gen max_`v' = `1' local others : list others - 1 foreach w of local others { replace max_`v' = max(max_`v', `w') } } Nick

Stephen Vaisey
Caroline H. and Thomas S. Royster, Jr. Fellow
Department of Sociology
University of North Carolina at Chapel Hill
200 Hamilton Hall (CB #3210)
Chapel Hill, NC 27599

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index