numeric vector or matrix with
n rows and
p columns.
The columns represent variables, each consisting of
n observations.
indices
numeric vector or matrix with
m rows and
B columns , containing
integer values between 1 and
n.
B is the number of bootstrap
samples and
m is the number of observations per sample.
OPTIONAL ARGUMENTS:
group
vector of length equal to number of rows of
x, dividing
x into groups.
If supplied, then the return values correspond to the sum (across groups)
of group means.
VALUE:
B x
p matrix, with
i,jth element equal to
mean(x[indices[,i],j])
(or product, sum, or variance).
SEE ALSO:
,
.
EXAMPLES:
data <- cancer.vet[,c("age","survival")]
obj <- bootstrap(data, mean, B=300, save.indices=T)
indexMeans(data, obj$indices)
# Linear approximation for a robust location estimate
set.seed(1); x <- rcauchy(40)
obj <- bootstrap(x, location.m, B=200, save.indices=T)
L <- resampGetL(obj)
plot(x, L) # outliers have less influence
plot(indexMeans(L, obj$indices), obj$replicates)