If DATA is a data frame with columns x and y, then do:
save.boot <- bootstrap(DATA, cor(x,y))
save.boot$replicates # Here are the 1000 values.
In general, to find this out, look at the help file for the function.
The section "Return Value" should describe the structure of the object.
For (2), if you want to save those 1000 values into a data frame, do
myDataFrame <- data.frame( myName = save.boot$replicates )
Tim Hesterberg
========================================================
| Tim Hesterberg Senior Research Scientist |
| timh@insightful.com Insightful Corp. |
| (206)802-2319 1700 Westlake Ave. N, Suite 500 |
| (206)283-8691 (fax) Seattle, WA 98109-3044, U.S.A. |
| www.insightful.com/Hesterberg |
========================================================
Download S+Resample from www.insightful.com/downloads/libraries
Bootstrap Methods and Permutation Tests
Oct 10-11 San Francisco
http://www.insightful.com/services/training.asp
>Dear S-News Members!
>
>
>--> I´m bootstrapping a correlation-coefficient as statistic of interest for
>two columns of a dataset. This works fine, but I´d also want to know the
>following:
>
>(1) How can I get all the, for example 1000, replicates of the
>correlation-coefficient (for further calculations)?
>
>
>(2) Furthermore, exists there a simple function/code/syntax to get all the
>replicates in a "new" column of a new created dataset (whichone S-Plus creates
>automatically)? I think it should be easy with the right Syntax/code, but I
>still haven´t found the right one yet.
>
>
>This works not that bad:
>>x[ indices[ 1, ] ]
>
>but exists there another, better solution?
>
>
>Additional information:
>I´m working with "Resample-library" on Windows XP and S-Plus Version 7.0.
>
>Apologies for my question, but I´m a beginner.
>I´d be very happy, if anyone could help me.
>
>Thanks und best wishes,
>Weigl Klemens
|