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]

st: could you please verify the correctness of the code?-tsfill function


From   stef salvez <loggyedy@googlemail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: could you please verify the correctness of the code?-tsfill function
Date   Tue, 5 Jun 2012 16:15:34 +0200

Dear all,


I have a panel data set. These data are available every 28 days (or 4
weeks). But in some case I have jumps (35 days  instead of 28 days).
So I used tsfill in the code which i display below



clear all
cd J:\
input id  str8 (dates)    var
 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   "23/11/08"  45
2  "28/12/08"   46
2  "25/01/09"   90
2  "22/02/09"  54
2  "29/03/09"   65
2   "26/04/09" 77
2  "24/05/09"   7
2   "28/06/09"  6
end


gen edate1 = date(dates, "DM20Y")
 gen edate2= floor(edate1/28)
tsset identif2 edate2
tsfill

I get no warnign sign which seems to be ok. But when I look at the
data editor  I have the feeling that something may not be correct:
So, I would like to ask if the above approach-code is correct


thanks
Stefanos
*
*   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