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

st: Question about programming using bootstrap


From   "feldman" <[email protected]>
To   [email protected]
Subject   st: Question about programming using bootstrap
Date   Thu, 15 Sep 2005 07:04:00 -0700

Statalisters,
I have a question about how to bootstrap a set of variables
using a single
command. More specifically what I am interested in doing is
the following.
I create a program that estimates a scalar for a set of
variables defined
in varlist. I then want to bootstrap that program to obtain
the standard
errors of each one of the scalars. Nevertheless, I can�t
find a way to tell
Stata to do this using a single command for bootstrap. Below
is the
relevant part of the code that I am using. I get the
bootstrapped standard
errors but in a very inefficient way because Stata repeats
the bs command
for each one of the variables in varlist and that can be
extremely time
consuming. I want to do this with a single bs command. 

Thanks, 
Alejandro 

P.S. My apologies if this message is repeated. I sent it
before from another email account (twice) but it didn�t
went through after more than 12 hours. 
_______

program define desc
.
.
.
foreach var of local varlist {
scalar mg`var' = sg`var' - s`var'
}
.
.
.

foreach var of local varlist {
set seed  5432198
bs "desc `varlist' " mg`var'=mg`var' , rep(`rep')
level(`level')
}
_______________


Alejandro Lopez-Feldman
Ph.D. Candidate
UC DAVIS
Agricultural and Resource Economics

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