Bookmark and Share

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]

st: RE: STATA date question


From   "Cohen, Elan" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: STATA date question
Date   Wed, 29 Jan 2014 16:32:40 +0000

A little clunky, but it works.  You might want to change how you define "18 months later" (i.e. incrementing the month variable, instead of the number of days).

g var2 = var + round(365.25*1.5)
forv i=0/6 {
  replace var2 = var2+`i' if dow(var2+`i')==4
}


HTH,

- Elan


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Ed Levitas
Sent: Wednesday, January 29, 2014 9:13
To: [email protected]
Subject: st: STATA date question

Hi Statalisters,

I'm trying to output dates  that occur on the Thursday after 18 months have passed since a beginning date. For example, assume my beginning date is January 1, 2014.  The Thursday after 18 months have passed from this date is July 2, 2015.  In this case, I am not concerned with how many days are in each month (e.g., I don't care that January 2014 has 31 days and February 2014 has only 28).  I treat month duration as equivalent regardless of days within each month.    I have examined datetime  but am still unsure as to how to accomplish this in STATA.  Can you please suggest a way in STATA to produce this output?

Thanks in advance for your time and consideration, 
Ed

****************************************
Edward Levitas, PhD
Associate Professor
Sheldon B. Lubar School of Business
University of Wisconsin-Milwaukee
3202 N. Maryland Ave.
Milwaukee, WI  53211
ph: (414) 229-6825
fx: (414) 229-6957
http://www4.uwm.edu/business/faculty/busfaculty/levitas.cfm




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


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index