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

st: filling in weekend dates

From   "Mingfeng Lin" <>
Subject   st: filling in weekend dates
Date   Thu, 19 Jun 2008 10:26:30 -0400


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

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.

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index