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

st: RE: RE: date functions

From   "Higdon, Keith M." <[email protected]>
To   <[email protected]>
Subject   st: RE: RE: date functions
Date   Thu, 17 Apr 2003 08:36:59 -0500

Thanks for your response.  I thought I was missing something.  Thanks


-----Original Message-----
From: Nick Cox [mailto:[email protected]] 
Sent: Thursday, April 17, 2003 3:20 AM
To: [email protected]
Subject: st: RE: date functions

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> 

[email protected] 

*   For searches and help try:

The information transmitted is intended only for the person or entity to which it is addressed
and may contain confidential and/or privileged material. Any review,retransmission, dissemination
or other use of, or taking of any action in reliance upon, this information by persons or entities
other than the intended recipient is prohibited. If you received this in error, please contact
the sender and delete the material from any computer.

*   For searches and help try:

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