title: Generating 99 datasets at once in R
body: <pre><code>#Generating 99 pairs of datasets
  for (i in 1:99) {
    set.seed(i)
    X1 &lt;- rnorm(100, mean=3, sd=sqrt(10))
    X2 &lt;- rnorm(100, mean=-2, sd=sqrt(3))
    X1sq &lt;- X1^2
    X2sq &lt;- X2^2
    X1X2 &lt;- X1*X2
    a &lt;- exp(0.2*X1sq + 0.3*X2sq + 0.7*X1X2)
    b &lt;- 1 + exp(0.2*X1sq + 0.3*X2sq + 0.7*X1X2)
    px3 &lt;- a/b
    Y &lt;- rbinom(100, 1, px3)
    newtest &lt;- data.frame(X1, X2, Y)
  }
  </code></pre>
  <p>Hi guys, essentially I would like to generate 99 pairs of data sets, via the loop function. And each new test should be a data frame consisting of new sets of values of X1, X2 and Y respectively.I am not sure if my loop written above is correct so I would like to seek help if possible!</p>