Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: creating unified set of dates


From   stef salvez <loggyedy@googlemail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: creating unified set of dates
Date   Sat, 16 Jun 2012 13:45:28 +0100

I forgot to add the following thing: the observations are available
every 4 weeks. So each observation is a 4-week average

thank you

On 6/15/12, stef salvez <loggyedy@googlemail.com> wrote:
> Dear all,
>
> I have a panel data set like the one below
>
> clear all
>
> input id  str8 (dates)    variable
>  1         "23/11/08"            2
> 1   "28/12/08"                   3
> 1    "25/01/09"                   4
> 1   "22/02/09"                   5
> 1    "29/03/09"                  6
> 1  "26/04/09"                   32
> 1  "24/05/09"                   23
> 1  "28/06/09"                   32
> 2   "26/10/08"                45
> 2  "23/11/08"                 46
> 2  "21/12/08"               90
> 2  "18/01/09"                54
> 2  "15/02/09"                 65
> 2   "16/03/09"               77
> 2  "12/04/09"                    7
> 2   "10/05/09"                   6
> end
>
>
>
> the start and end date of the time series for countries 1 and 2 are
> different. For example, for country 1 the time series begins on
> "23/11/08" while for country 2 the time series begins on "26-10-2008”.
>
> My data on prices are available every 28 days (or equivalently every 4
> weeks). But in some cases I have jumps (35 days or 29 days instead of
> 28 days). For example from the above table we have such jumps: from
> "28/12/08" to "28/12/08" , from 22/02/09" to "29/03/09", etc
>
> My goal is to have a unified sequence of dates across countries. So,
> to achieve this I want to apply two solutions (Nick, it was you that
> you proposed them!)
>
> 1) to interpolate the dates to a common set of dates (with the
> distance between successive dates be 28 days)
>
>
> 2)I to take what I have and calculate monthly average prices and also
> report how many prices those averages are based on. I suppose that I
> will still have gaps and may well need to interpolate.
>
> Please, I would be grateful to you if you could provide the exact code
> in order to achieve these 2 goals. I should not ask this but If I am
> not in the position of creating this unified sequence of dates I will
> not be able to do the analysis that I want. Suggestions are welcome
> but not very helpful as I am not very familiar with stata and I am
> afraid that I will never make it on my own.
>
> thank you for your understanding
>
> *
> *   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/
>

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