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

st: RE: date functions


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: date functions
Date   Thu, 17 Apr 2003 09:20:12 +0100

Higdon, Keith M. (modulo deprecated MIME/HTML) 

> Is there a way to use the gen edate function to transform numerous 
> date fields into elapsed dates with different variable names?  

Other answers have not addressed the issue of multiple variables. 

For that, I recommend a -foreach- loop and some systematic name 
change such as a prefix: 

foreach v of var <varlist> { 
	gen e`v' = <function call> 
} 

Nick
n.j.cox@durham.ac.uk 

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