Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: bootstrapping and time series


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: bootstrapping and time series
Date   Fri, 08 Oct 2004 09:41:39 -0500

Mark Schaffer <[email protected]> asks about using -bootstrap- with
time series operated variables:

> Hi everybody.  A week or so ago Vidya Mahambare reported a problem 
> with bootstrapping and GMM using ivreg2.
> 
> It turns out the issue is not ivreg2, but any estimation using time 
> series operators.
> 
> An example:
> 
> use http://fmwww.bc.edu/ec-p/data/wooldridge/phillips.dta
> tsset year, yearly
> 
> gen lunem=l.unem
> gen l2unem=l2.unem
> 
> * These two ivreg2 command generate exactly the same output:
> ivreg cinf (unem = l.unem l2.unem)
> ivreg cinf (unem = lunem l2unem)
> 
> * This bootstrap works fine:
> bootstrap "ivreg cinf (unem = lunem l2unem)" _b, reps(100) bca
> * But this one dies:
> bootstrap "ivreg cinf (unem = l.unem l2.unem)" _b, reps(100) bca
> 
> The output from the last command is reported below.  Anyone have any 
> idea why this is so?  I am not a bootstrap expert, so for all I know 
> this is expected behaviour and not a bug.

-bootstrap- cannot work with processes that require the sort order of the data
to be preserved.  The data needs to be in the correct "time" order for Stata
to work with time-series operators; however, -bootstrap- performs random
sampling with replacement which is not compatible with -tsset- and time-series
operators.  This sampling scheme implies that it is possible to observed each
unit of observed time more than once in any given bootstrap sample.

Mark seems to have found a way around this by generating the variables he
needs before running -bootstrap-.  Since -ivreg- doesn't require the data to
be -tsset-, -bootstrap- is able to perform its task and provide meaningful
results.

--Jeff
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index