Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Need help programming for dates in Stata


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
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
<michaelstewartresearch@gmail.com> 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 <njcoxstata@gmail.com> wrote:

>> Nice.

On Tue, Mar 5, 2013 at 7:39 PM, Jeph Herrin <stata@spandrel.net> 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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index