Re: [R] trouble double looping to generate data for a meta-analysis

2016-07-03 Thread Jim Lemon
Hi Marietta, You may not be aware that the variable k is doing nothing in your example except running the random variable generation 2 or 3 times for each cycle of the outer loop as each successive run just overwrites the one before. If you want to include all two or three lots of values you will h

Re: [R] trouble double looping to generate data for a meta-analysis

2016-07-02 Thread Michael Dewey
Dear Marietta Comments in-line On 01/07/2016 18:28, Marietta Suarez wrote: i'm trying to generate data for a meta analysis. 1- generate data following a normal distribution, 2- generate data following a skewed distribution, 3- generate data following a logistic distribution. i need to loop this

Re: [R] trouble double looping to generate data for a meta-analysis

2016-07-01 Thread Bert Gunter
Hint: It's much more efficient not to loop and generate random data in a single call only once -- then make your samples. (This can even often be done with different distribution parameters, as in many cases these can also be vactorized) Example: ## 1000 random samples of size 100 > set.seed(112

Re: [R] trouble double looping to generate data for a meta-analysis

2016-07-01 Thread Federman, Douglas
You might look at the package Wakefield For data generation -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Marietta Suarez Sent: Friday, July 01, 2016 1:28 PM To: r-help@r-project.org Subject: [R] trouble double looping to generate data for a meta

[R] trouble double looping to generate data for a meta-analysis

2016-07-01 Thread Marietta Suarez
i'm trying to generate data for a meta analysis. 1- generate data following a normal distribution, 2- generate data following a skewed distribution, 3- generate data following a logistic distribution. i need to loop this because the # of studies in each meta will be either 10 or 15. k or total numb