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

[email protected]
*   For searches and help try:

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