\begin{Schunk}
\begin{Sinput}
 ##' Create one data set for the first born question
 ##'
 ##' This uses a vectorized call to rnorm
 ##' @param rep Integer to name repetition
 ##' @param N Sample Size
 ##' @param M1 Mean of first born group
 ##' @param M0 Mean of non-first born group
 ##' @param SD1 Standard Deviation of first born
 ##' @param SD0 Standard Deviation of non-first born
 ##' @return A data frame
 ##' @author Paul Johnson
 ## define a data-generator function for one replication
 getData <- function(rep, N, M1, M0, SD1, SD0) {
      dat <- data.frame(first = rbinom(n = N, size = 1, prob = .4))
      dat$rep <- rep
      dat$IQ <- rnorm(N, m = M0 + dat$first * (M1 - M0), 
                         s = SD0 + dat$first * (SD1 - SD0))
      dat$IQ <- round(dat$IQ)
      dat
  }
\end{Sinput}
\end{Schunk}
