Bookmark and Share

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: bootstrap saving option


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   Re: st: bootstrap saving option
Date   Sun, 6 Feb 2011 09:49:02 -0500

--

The only variables listed in -ereturn list- that you can specify in the -bootstrap- commmand are the "scalars" listed first, not the matrices.

Save the coefficients by specifying them as _b[] variables. Type "help _variables". If you have lots of predictors, you can get all the coefficients by specifying "_b" instead of individual names. See below and the examples in the "help" for -bootstrap-.

If you want to run more than one model, save the results for each model to a different file and then append the results.
*******************
sysuse auto, clear
tempfile t1 t2 t3
bootstrap rmse=e(rmse) _b, ///
 saving(`t1',replace) rep(10): reg mpg weight turn
use `t1', clear
gen byte model =1
save `t2'

sysuse auto, clear
bootstrap rmse=e(rmse) _b, ///
 saving(`t3',replace) rep(10): reg mpg weight turn foreign
use `t3', clear
gen byte model =2
append using `t2'
des
****************************

Steve


On Feb 6, 2011, at 9:09 AM, Liwu wrote:

Thanks, Steve.
It helps me a lot.
Is there any way that I can save this matrix as new variables in the file?
I know I can use the following code:
mat beta=e(b)
svmat double beta, names(matcol)

However, if I want to run another bootstrap and save the e(b) in the
second column (i.e., not overlap the first e(b) in the first column
under the same variables), I have no idea so far. Thanks for your
help.

Thanks,
Liwu




----------
Date: Sat, 5 Feb 2011 10:00:19 -0500
From: Steven Samuels <[email protected]>
Subject: Re: st: bootstrap saving option

bootstrap rmse=e(rmse) _b[weight] _b[turn], rep(10): reg mpg weight turn

Steve
[email protected]
*
*   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/

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index