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]

Re: st: Inexplicably missing values for lagged variables


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Inexplicably missing values for lagged variables
Date   Mon, 9 Jul 2012 16:52:18 +0100

Length of panels has no influence whatsoever on how lags are handled.

We can't tell you anything about your data that you don't know, but it
could be that you have gaps in your data.

For example, if a panel contains observations for years 2000 2002 2004
2006 2008 2010, and you -tsset- or -xtset- in terms of  a year
variable, then all L. variables will be missing, as in no case is
there an observation for the previous year.

Irregularly spaced data or more generally gaps in the data have just
the same effect as missing values as far as lag and other time series
operators are concerned.

Nick

On Mon, Jul 9, 2012 at 4:41 PM, Clive Gilbert <clivegilbert@gmail.com> wrote:

> Thanks Maarten. My raw data set does not contain any missing values as
> such, although it is unbalanced. I have considered the possibility
> that the fact some of the panels are shorter  than the others might
> cause the lags for the those panels to be generated differently.
> However, if that were the case, I would expect the missing values to
> be only among shorter panels but they aren't.

> On Mon, Jul 9, 2012 at 3:43 PM, Maarten Buis <maartenlbuis@gmail.com> wrote:

>> On Mon, Jul 9, 2012 at 4:22 PM, Clive Gilbert wrote:
>>> I am working with panel data and have a number of lagged variables. I
>>> have noticed that some individuals have missing values for certain
>>> years whereas others do not .
>>
>> The first observation for each unit will be missing for lagged
>> variables, as you would need the preceding value and the preceding
>> value by definition is not present in the data for the first
>> observation. If a preceding year is not present in your dataset, then
>> that would also result in missing values.
*
*   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