Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: bootstrap a parameter vector


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: bootstrap a parameter vector
Date   Fri, 17 Feb 2006 14:21:28 -0600

Edwin Leuven <[email protected]> is trying to -bootstrap- a parameter vector
using a special wrap-around script of -dprobit-:

> i am trying to bootstrap a parameter vector.
> 
> i have written an eclass program along the lines of this:
> 
> cap program drop eff
> program eff, eclass
> dprobit geb bdate girl p2 p5 if achter==1
> tempvar t
> g `t' = e(sample)
> matrix b = e(dfdx)
> eret post b, esample(`t')
> end
> 
> if i read the documentation well i can now bootstrap my estimates as 
> follows:
> 
> . bootstrap , reps(100): eff
> 
> or
> 
> . bootstrap _b , reps(100): eff
> 
> 
> but both throw an error:
> 
> . bootstrap , reps(100): eff
> (running eff on estimation sample)
> last estimation results not found, nothing to store
> estimation result __000002 not found
> r(111); t=0.17 15:27:41
> 
> 
> does anyone know what i am doing wrong here?

Estimation commands used with -bootstrap-, -jackknife-, and other prefix type
commands that consume estimation results need to identify their results as
their own by setting -e(cmd)-.  This is a requirement of -estimates store-.

Here is how to modify Edwin's -eff- program to get it to work properly with
-bootstrap-:

program eff, eclass
	dprobit geb bdate girl p2 p5 if achter==1
	tempvar t
	g `t' = e(sample)
	matrix b = e(dfdx)
	eret post b, esample(`t')
	eret local cmd eff		// <- new line
end

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