Skip to content

Simulation over data repeatedly for four loops

2 messages · Francesca PANCOTTO, R. Michael Weylandt

#
Perhaps you might want to abstract your code a bit and try something like:

X = rnorm(500) # Some Data
replicate(1e4, mean(sample(X, 500, replace = T)))

Obviously you can set up a loop over your data sets as needed.

Michael
On Sat, Nov 12, 2011 at 6:46 PM, Francesca <francesca.pancotto at gmail.com> wrote: