Statalist The Stata Listserver


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

Re: st: shorthand


From   Timothy.Mak@iop.kcl.ac.uk
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: shorthand
Date   Mon, 5 Jun 2006 14:23:45 +0100

This is ok if my variables are a100, a101, a102, and so on, but it 
wouldn't work if I have say a101a, a102a, a102b, a103_oth, and so on, 
variables that have the same root but don't have other things in common... 


But thanks anyway. 

Tim 




Dominic Muston <dom.muston@googlemail.com> 
Sent by: owner-statalist@hsphsun2.harvard.edu
05/06/2006 14:12
Please respond to
statalist@hsphsun2.harvard.edu


To
statalist@hsphsun2.harvard.edu
cc

Subject
Re: st: shorthand






Timothy,

I'm not sure this is shorter!

gen logical==1
forvalues i=100(1)200 {
     replace logical = 0 if a`i'!=.
}
list if logical==1

Dominic Muston.
*
*   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/

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