Re: [R] Simulation over data repeatedly for four loops

2011-11-13 Thread 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 wrote: > Dear Contributors,

[R] Simulation over data repeatedly for four loops

2011-11-12 Thread Francesca
Dear Contributors, I am trying to perform a simulation over sample data, but I need to reproduce the same simulation over 4 groups of data. My ability with for loop is null, in particular related to dimensions as I always get, no matter what I try, "number of items to replace is not a multiple