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

st: bootstrapping ado files that use the post estimation b


From   "Schonlau, Matthias" <matt@rand.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: bootstrapping ado files that use the post estimation b
Date   Tue, 26 Oct 2004 21:36:46 -0700

Hallo Stata-listers!

bootstrapping ado files that use _b  (post estimation)

I am having difficulties running  bootstrap on a self-written 
ado file "test1" that uses _b (post estimation). The code for "test1" is below (the
 real ado is more complicated , this is just the skeleton)

I would like to run this as follows

logistic y x1-x5
test1 x1-x5 

test1   uses the _b[varname] and _se[varname]. 
I would now like to bootstrap this function:

bs "test1 x1 "  "r(rr1)", trace


I get the following error:
 	      - local coef= uniform() * _b[`z']
              = local coef= uniform() * _b[v1female]
no variables defined


The problem is that the bootstrap does not recodnize the _b and _se from the 
logistic regression.

Is there a way of telling the bootstrap to use the estimation 
results from logistic regression?

Thanks 

matt 

---------------------------------------------------------------------

program define test1, rclass
	version 8.0
	syntax varlist

	local k : word count `varlist'
	tokenize "`varlist'"

	forval i = 1 / `k' { 
		local z="``i''" 
		di "`z'"
		local coef= uniform() *  _b[`z']
		local se= uniform() *  _se[`z']
		return scalar coef`i'= `coef'
	}
end 


Matthias Schonlau
Statistician, RAND 
http://www.rand.org/methodology/stat/members/matt/

--------------------

This email message is for the sole use of the intended recipient(s) and
may contain privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.



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