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 for observations belonging to the same individual.
Taking into consideration the panel nature of the data, I want to generate many bootstrap samples with replacement and store each bootstrap sample data frame for further use. Sampling (or selection into the bootstrap sample) shall be based on individuals (on unique values of *id*) such that if an individual is in a particular bootstrap sample, so will all observations belonging to that individual. How can I do this in r? [[alternative HTML version deleted]] ______________________________________________ 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.