Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: filling in weekend dates


From   "Mingfeng Lin" <mingfeng.lin@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: filling in weekend dates
Date   Thu, 19 Jun 2008 10:26:30 -0400

Hello,

Is there a way to create new rows and then fill in weekend dates
automatically in Stata? For instance, I have a series of stock prices,
and Jan01-Jan05 are Monday-Friday, and weekend dates are not
available.

Jan01 100
Jan02 102
Jan03 110
Jan04 101
Jan05 111               /* <= This is a Friday */
Jan08 121
Jan09 152
Jan10 132
...

What I want to do is to "insert rows", say Jan06 and Jan07, such that
they take on the value of Jan05.  The only way I can think of is to
create this series of dates in Excel, then import to Stata and merge
it, and then use [_n-1] to replace the missing values.  But is there a
more straightforward way? I have a bunch of these files with different
date ranges and it's really inefficient.

Many thanks for any suggestions you can provide.

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