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: could you please verify the correctness of the code?-tsfill function


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: could you please verify the correctness of the code?-tsfill function
Date   Wed, 6 Jun 2012 01:07:41 +0100

Your code does not run without correction. Apart from

cd J:\

which will not work if such a drive does not exist, you need to change
-identif2- to -id-. But you could have checked the code yourself
before posting it. Otherwise I don't know how to respond to your
"feeling that something may not be correct".

I guess you got no answers first time you posted this because people
could not work out what you were asking.

Nick

On Tue, Jun 5, 2012 at 8:45 PM, stef salvez <[email protected]> wrote:

> I was wondering if someone could check the validity of the code.  If I
> violate any rules I would be grateful to you if you could inform me
> about it
>
>
> thanks
>
> On 6/5/12, stef salvez <[email protected]> wrote:
>> ok
>>
>> On 6/5/12, stef salvez <[email protected]> wrote:
>>> 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
>>>

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