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: How to convert Daily data with gaps to weekly?
From
Christopher Baum <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: How to convert Daily data with gaps to weekly?
Date
Sat, 10 Mar 2012 12:21:24 -0500
<>
On Mar 7, 2012, at 2:33 AM, Joao wrote:
> I'm working with a time series of guava price like this:
>
> input str11 date preco_goi
> 7-Oct-2004 9.00
> 10-Oct-2004 8.00
> 12-Oct-2004 8.00
> 14-Oct-2004 7.00
> 17-Oct-2004 6.00
> 19-Oct-2004 6.00
> 21-Oct-2004 7.00
> 24-Oct-2004 7.00
> 26-Oct-2004 8.00
> 28-Oct-2004 9.00
> 31-Oct-2004 9.00
> 2-Nov-2004 9.00
> 4-Nov-2004 10.00
> 9-Nov-2004 10.00
> 11-Nov-2004 10.00
> 14-Nov-2004 10.00
> 16-Nov-2004 9.00
> 18-Nov-2004 8.00
> 21-Nov-2004 8.00
> 23-Nov-2004 7.00
> 25-Nov-2004 7.00
> 28-Nov-2004 7.00
> 30-Nov-2004 7.00
> end
>
> The time series is daily but with gaps. Thus, I can´t use the -dfgls-
> command, for example and others TS commands.
>
> What can I do in this case? Can I convert the daily data with gaps to
> weekly? Is there a better procedure to do the trick?
Just create a sequential variable:
g t = _n
tsset t
In Stata 12 you can also set up a business-daily calendar which only contains trading days.
Kit
Kit Baum | Boston College Economics & DIW Berlin | http://ideas.repec.org/e/pba1.html
An Introduction to Stata Programming | http://www.stata-press.com/books/isp.html
An Introduction to Modern Econometrics Using Stata | http://www.stata-press.com/books/imeus.html
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/