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 <vaisey@unc.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: RE: RE: minimum of "all other variables"
Date   Tue, 17 Oct 2006 08:32:41 -0400

Nick,

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.)

Steve


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 n.j.cox@durham.ac.uk

--
================================================
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
WEBSITE: www.unc.edu/~vaisey
DISS. INTRO.: www.unc.edu/~vaisey/diss_intro.pdf
================================================

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index