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: loop for bootstrap ?
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: loop for bootstrap ?
Date
Wed, 2 May 2012 10:27:00 +0200
--- On Wed, May 2, 2012 at 10:04 AM, econqian222 wrote:
> I want to run a bootstrap by product(1,2,3,...) , the command is
> written as:
> bysort product: bootstrap rmse=e(rmse), reps(100) seed(12345): regress
> value quantity index
>
> If this bootstrapping method can't be combined with "bysort", then how to
> write a loop for this bootstrap?
*------------- begin example -------------
sysuse auto, clear
recode rep78 1/2=3
levelsof rep78
foreach lev in `r(levels)' {
regress price mpg foreign, vce(bootstrap)
}
*-------------- end example --------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )
-- Maarten
--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany
http://www.maartenbuis.nl
--------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/