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

st: Business date for panel data


From   Thomas Leirvik <thomas.leirvik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: Business date for panel data
Date   Wed, 27 Feb 2013 01:09:26 +0100

Dear Statalisters,

I have a question regarding the lag operator:

I have a panel dataset  and would like to generate a new variable with the lag of a variable. It's not necessarily any quoted price each business day, so there are some missing values, but I do not want to treat Saturdays and Sundays as missing.
In order to apply the L.varname function, I need to make the dataset a paneldata, which I do by:

xtset id date

then Saturday, Sunday and holidays are treated as missing values.I do not know how to go around this problem. I searched the online and the pdf files for Stata, and it is suggested to use command for the business calendar:

xtset id datet, format(%tbsimple:)

but it does not change anything. 
Is there a way to avoid this problem? 

Best,
Thomas
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index