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

st: RE: Dealing with dates


From   "de la Garza, Adrian" <[email protected]>
To   <[email protected]>
Subject   st: RE: Dealing with dates
Date   Wed, 12 May 2004 12:59:26 -0400

Justin,

You could just extract the year and the month from these, like so:

(Supposing that your current date variable is called -date-)

generate year = real(substr(date,1,4))
generate month = real(substr(date,6,2))
generate paneldate = ym(year,month)
format paneldate %tm

-paneldate- is your new date formatted as a time-series variable that
you can use for panel regressions and time-series analysis.

Hope this helps.
Adrian

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] 
> Sent: Wednesday, May 12, 2004 12:47 PM
> To: [email protected]
> Subject: st: Dealing with dates
> 
> 
> I have a panel data set with countries and years in rows.  I 
> can't declare my
> set to be time series because my dates have decimal points.
> 
> Country1    1960.01
> Country1    1960.02
> COuntry2    1960.01
> etc...
> 
> How do I get these into workable form for time series analysis?
> 
> Thanks
> Justin
>  
> 
> 
> 
> *
> *   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/
> 

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