Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Extract Values from bootstrap operation


From   Rahber Thariani <thariani@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Extract Values from bootstrap operation
Date   Mon, 31 Dec 2012 18:44:26 -0800

Thanks for the reply!

I'm actually trying to save the mean and the 5th and 95th ci values.

When I try

noi bootstrap y0_bs=r(mean),saving("output.dta", replace): sum y0_hold

I only get the mean values saved.

I tried using level(95) in my code too but that doesn't seem to work.

So I'm looking to basically save the mean and ci values from my bootstrap.

Appreciate any advice you guys can bring.

Thanks!

R

On 12/19/2012 10:44 AM, Nick Cox wrote:
The -saving()- option of -bootstrap- is used for this purpose. It
wouldn't make much sense to generate variables, in the current dataset
as the results couldn't be aligned logically with the current
observations and in general the number of samples need not be the same
as the number of observations.

Nick

On Wed, Dec 19, 2012 at 6:36 PM, Rahber Thariani <thariani@gmail.com> wrote:

I'm a noob at Stata and running into an issue extracting values from a
bootstrap operation. I'm running Stata 12.

I have

drawnorm y1 y0, n(500) means(m) sds(sd) corr(corr)  cstorage(lower)

gen d = (uniform() >0.5)
  gen y = d*y1 + (1-d)*y0
gen y0_hold=y if d==0
noi bootstrap y0_bs=r(mean): sum y0_hold
gen y1_hold=y if d==1
noi  bootstrap y1_bs=r(mean): sum y1_hold

I can see the results of the bootstrap on screen but don't know how to
access them, and assign to a variable and then save to a file.

So

1) How do I assign the different values on screen to different variables,
like the co-efficient, 95% interval etc?
2) How do I save the variables to a specific file.
*
*   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/

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index