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: Collapsing daily data to a monthly data on the 15th each month


From   Toby Knapen
To   [email protected]
Subject   st: Collapsing daily data to a monthly data on the 15th each month
Date   Tue, 21 Jan 2014 18:42:07 +0100

Dear Statalisters,

I would like to transform my daily data to monthly data, calculated on
the 15th of each month, more precisely, from the 16th day of a
specific month up to and including the 15th day of the following
month. The problem is that I can only find the way to this it based on
'regular' months. This can be done by using the following commands:

g dm=mofd(date)
format dm %tm
collapse  prc ret shrout vwretd ewretd, by (dm)
tsset dm, monthly

Since I'm having inflation dates on the 15th each month I would like
to have the monthly data on the 15th as well, otherwise there will be
a mismatch in my data. The data on my dates looks like below:

16dec2002
17dec2002
18dec2002
19dec2002
20dec2002
23dec2002
24dec2002
26dec2002
27dec2002
30dec2002
31dec2002
02jan2003
03jan2003
06jan2003
07jan2003
08jan2003
09jan2003
10jan2003
13jan2003
14jan2003
15jan2003
16jan2003
17jan2003
21jan2003
22jan2003
23jan2003
24jan2003
27jan2003
28jan2003


Hopefully someone can help me out. Thanks in advance!


Kind regards,

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