Hi R-Group, I am stuck with the following problem: I am constructing a portfolio of 2 variables x and y
x <- rnorm(100, mean=100, sd=4) y <- rnorm(100, mean=120, sd=10) which I am combining as follows to a portfolio for sampling purposes: portfolio <- c(rep(x, 8), rep(y, 2)) In this case I have assigned the weights of 8 and 2 to calculate the bootstrapped mean: mean.boot <- function(z){ mean(sapply(lapply(1:20, function(i)sample(z, replace=F, size=30)), mean))} So far so good. But how can I bring it into table-form whereby the combination of all 10 different weights (setting steps as 1) and their respective bootstrapped means are printed: weights mean.boot 1 .... 2 .... ... .... 10 .... How can I do this? Any suggestions most welcome. Many thanks! Bernd ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.