Re: [R] Generating bootstrap samples from a panel data frame

2013-11-14 Thread Dereje Fentie
With a sample data frame: d = data.frame(id = rep(c(1,2,3,4),5), x = round(rexp(20), digits=2), y = round(runif(20), digits=2)) I would like to generate 100 bootstrap data with replacement and save each bootstrap data as b1, b2, ..., b100. I attempted the sample function but could not make it

[R] Generating bootstrap samples from a panel data frame

2013-11-11 Thread Dereje Fentie
With a data frame (call it *d*) composed of 2000 individuals and *n*observations for each individual (thus *2000n* observations in total), I would like to generate *k* bootstrap samples with replacement from *d*. Amongst other variables, *d* has a numeric variable *id* taking on identical value