[R] build boot object for boot.ci
Daniel Metzler
daniel.metzler at gmx.net
Thu Jan 5 21:36:40 CET 2006
Hello all,
I have a dataset with several variables v1...vn and five groups f1...fn.
For each group I took a subset of the data
f1<-subset(data,f==1)
f2<-subset(data,f==2)
and bootstrapped the weighted mean for v1...vn, which worked
nicely.
data.boot<-boot(f1$v1,mymean,R=2000)
Afterwards I combined all boot.out$t for each group:
boot$f1v1<-data.boot$t
data.boot<-boot(f1$v2,mymean,R=2000)
boot$f1v2<-data.boot$t
...
data.boot<-boot(f2$v1,mymean,R=2000)
boot$f2v1<-data.boot$t
...
Each row of boot is used as input in a model resulting in boot$W.
My idea is to find (bootstrap) CIs for W.
Sorry, I'm new to bootstrap (and R...): Does it make sense to treat
the Ws like a bootstrapped variable (and calculate e.g. BCa CIs),
because only v1..vn
are bootstrapped? If yes, how is a boot object build on the basis of
boot$W?
I'm aware that boot() handles strata, weights and complex functions,
but I didn't manage to get my model bootstrapped right. Hopefully, I
can circumvent turning my
script upside down.
Daniel
More information about the R-help
mailing list