[R] vectorize a power analysis?

2010-05-12 Thread Jack Siegrist
We are doing a power analysis by generating noisy data sets according to a model, fitting the model to the data, and extracting a p-value. What is the best way to do this many times? We are just using for loops and it is too slow because we are repeating the analysis for many parameterizations. I

Re: [R] vectorize a power analysis?

2010-05-12 Thread Chuck Cleland
On 5/12/2010 3:34 PM, Jack Siegrist wrote: We are doing a power analysis by generating noisy data sets according to a model, fitting the model to the data, and extracting a p-value. What is the best way to do this many times? We are just using for loops and it is too slow because we are

Re: [R] vectorize a power analysis?

2010-05-12 Thread jim holtman
You should profile (Rprof) your code to see where it is spending it time; this will point you to what needs to be optimized. On Wed, May 12, 2010 at 3:34 PM, Jack Siegrist jack...@eden.rutgers.eduwrote: We are doing a power analysis by generating noisy data sets according to a model, fitting