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

Re: st: Years to dates


From   Seb Buechte <[email protected]>
To   [email protected]
Subject   Re: st: Years to dates
Date   Tue, 20 Sep 2005 20:26:22 +0200

Terra Curtis asked for an easy way to create a certain date within a known year:

I think of one way, eventhough I am not very familiar with time-series
data, I guess it should still work:

(let the variable "year" be the container of your years than it should
work the following way:)

gen variable1=mdy(1,1,year)
gen variable2=mdy(12,31,year)

kind regards
sebastian


On 9/20/05, Terra Curtis <[email protected]> wrote:
> Dear Statalist,
> 
> I have a two variables of type %ty (for example, 1998).  I wish to change
> variable1 to 01/01/1998 and variable2 to 12/31/1998.  Is there an easy way
> of doing this?
> 
> Thanks,
> Terra
> 
> *
> *   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/
> 


-- 
- Seb F Buechte
-
- Stay tuned!

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index