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

Re: st: bootstrapping and time series


From   "Mark Schaffer" <M.E.Schaffer@hw.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: bootstrapping and time series
Date   Fri, 08 Oct 2004 17:27:56 +0100

Jeff et al.,

Thanks for the very clear explanation.  Just as a footnote in case 
anyone is interested, my workaround doesn't work if the estimator 
uses time series operators internally: newey, for example, or ivreg2 
with the bw() option.

Cheers,
Mark

From:           	jpitblado@stata.com (Jeff Pitblado, StataCorp LP)
To:             	statalist@hsphsun2.harvard.edu
Subject:        	Re: st: bootstrapping and time series
Date sent:      	Fri, 08 Oct 2004 09:41:39 -0500
Send reply to:  	statalist@hsphsun2.harvard.edu

> Mark Schaffer <M.E.Schaffer@hw.ac.uk> 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
> jpitblado@stata.com
> *
> *   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/

Prof. Mark E. Schaffer
Director
Centre for Economic Reform and Transformation
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS  UK
44-131-451-3494 direct
44-131-451-3008 fax
44-131-451-3485 CERT administrator
http://www.som.hw.ac.uk/cert

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index