Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Filling Missing Times/Dates and Corresponding Variable Entries |

Date |
Thu, 26 May 2011 10:03:30 +0100 |

This is surely a standard problem with this kind of data. I don't think it's like an interpolation problem in which there is a gap because someone forgot to take a measurement or the record is illegible or whatever, as is common in meteorology, for example. One answer is that the clock stops when no-one is trading, so you shouldn't interpolate: you just work in terms of business time. See SJ-7-1 dm0028 . . . . . . . . . . . . Stata tip 40: Taking care of business . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C. F. Baum Q1/07 SJ 7(1):137--139 (no commands) tip for dealing with time-series date schemes and how to handle gaps for a discussion. If you do interpolate, it messes up your dependence structure, not to mention the spectrum. Either way, examiners and/or reviewers would expect you to be familiar with what is standard in your field, rather than invent something ad hoc. Nick On Thu, May 26, 2011 at 9:20 AM, Muhammad Anees <aneesmkhattak@gmail.com> wrote: > I have the following examplified stock market data on three different > companies in different csv files for the same times or dates in each > sheet: > > time share price market capitalization > volume > > 01JAN2005 20 2000 > 10022 > 02JAN2005 21 2001 > 10023 > 03JAN2005 22 2002 > 10024 > 04JAN2005 23 2003 > 10025 > 05JAN2005 24 2004 > 10026 > . > . > 08JAN2005 26 2007 > 10029 > 09JAN2005 27 2008 > 10030 > 10JAN2005 28 2009 > 10031 > 11JAN2005 29 2010 > 10032 > 12JAN2005 30 2011 > 10033 > . > . > and so on where the missing date is either a weekend or public holidy. > > Now my problem is how to fill the time gaps and the corresponding > values for given variables using either values on the prior dates of > each variable or average of the last and next working dates. I know > stata offers ways to fill missing values but how can I do it in this > case. > > Thank you very much in advance for guiding me through the problem. * * 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/

**References**:**st: Filling Missing Times/Dates and Corresponding Variable Entries***From:*Muhammad Anees <aneesmkhattak@gmail.com>

- Prev by Date:
**st: Filling Missing Times/Dates and Corresponding Variable Entries** - Next by Date:
**st: Use of results in variable name** - Previous by thread:
**st: Filling Missing Times/Dates and Corresponding Variable Entries** - Next by thread:
**st: Use of results in variable name** - Index(es):