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]

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


From   Nick Cox <[email protected]>
To   [email protected]
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 <[email protected]> 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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index