[R] function in boot

From: YIHSU CHEN <yschen_at_jhu.edu>
Date: Fri 30 Jun 2006 - 00:26:29 EST

Dear R users:

I'm trying to use "boot" function under the package boot to run some bootstrapping.

Basically, I have a df as follows. (The data is simplified for illustrative purpose.)

V1 V2 V3
1 2 3
4 5 7
3 5 2

Say that I want bootrap among (V1,V2,V3) for 1000 times and calculate the average of them, ie., v_bar still has lenght of 3. I think my question is really how to write bf function below.

bf <- function(d,f)

    gp1 <- 1:3 #indicate random draw from three series     dmean <- apply(d[,gp1]*f[gp1],1,mean) }
a <- boot(df,bf, R=1000, stype="f")

Any help or suggestions? Many thanks.


R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jun 30 00:38:41 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 30 Jun 2006 - 02:12:38 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.