Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Saving bootstrap samples
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: Saving bootstrap samples
Date
Fri, 14 Jun 2013 15:40:54 +0200
On Fri, Jun 14, 2013 at 3:31 PM, Margaret MacDougall wrote:
> I would value some tips on how best to go about saving bootstrap samples
> generated by means of the bootstrap command in Stata.
Do you want to save the samples or the statistics computed in each
sample? The latter can easily be achieved using the -saving()- option.
The former is harder. You'll probably have to abandon -bootstrap- and
code the loop yourself and draw random observation in each iteration
using -bsample-. It is probably most convient to store those samples
as fweights, like so:
forvalues i = 1/10 {
qui gen w`i' = .
bsample , weight(w`i')
}
Hope this helps,
Maarten
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/