Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Need help programming for dates in Stata
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: Need help programming for dates in Stata
Date
Tue, 5 Mar 2013 19:53:15 +0000
This is to underscore that Jeph's solution is better than mine.
Nick
On Tue, Mar 5, 2013 at 7:47 PM, Michael Stewart
<[email protected]> wrote:
> Thank you for so many responses
> I will go through them all and let you know
> The reason I didnt put my code .. I was hopelessly lost
> I fiddled with using inrange and inlist commands but was going nowhere.
On Tue, Mar 5, 2013 at 2:42 PM, Nick Cox <[email protected]> wrote:
>> Nice.
On Tue, Mar 5, 2013 at 7:39 PM, Jeph Herrin <[email protected]> wrote:
>>> forv y=2009/2012 {
>>> gen used_`y'= inrange(`y',yofd(startdate),yofd(stopdate))
>>>
>>> }
>>>
>>>
>>>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/