[R] problem with strata in boot
Richard Chandler
rchandler at forwild.umass.edu
Fri Apr 29 13:50:07 CEST 2005
Hello,
I am new to R, and am having trouble running a stratified bootstrap.
My data set consists of 38 study sites in which I recorded the number
of bird pairs. Each site has been classified as burned or mowed and
for each of these two strata I would like to determine the precision
of an overall density estimate. I can run an unstratified bootstrap
without problem, but when I specify the strata I get the same
unstratified result.
cswafun <- function(denboot, i) sum(cswa[i])/(sum(parea[i])
attach(denboot)
cswa.boot <- boot(denboot, cswafun, R = 10000, strata = treat)
###
cswa is a vector of integers representing the number of pairs/site
parea is a numeric vector of the size of each study site
treat is a character vector of 'b's and 'm's. I have also coded this
as a numeric vector of '1's and '2s'. R returns the following:
Call:
boot(data = denboot, statistic = cswafun, R = 10000, strata = treat)
Bootstrap Statistics :
original bias std. error
t1* 1.109612 0.02641786 0.2032927
Any help would be appreciated. Thanks
Richard
--
Richard Chandler, M.S. Candidate
Department of Natural Resources Conservation
UMass Amherst
(413)545-1237
More information about the R-help
mailing list