\begin{Schunk}
\begin{Sinput}
 ## Define a function for one replication
 getTdata <- function(rep, N, M, SD) {
      ## tease apart two sample sizes
      Nvec <- as.numeric(unlist(strsplit(N, ":")))
      ## tease apart two means
      Mvec <- as.numeric(unlist(strsplit(M, ":")))
      ## tease apart two SDs
      SDvec <- as.numeric(unlist(strsplit(SD, ":")))
  
      ## assign dummy variables to each group's data set
      dat <- data.frame(first = c(rep(0, times = Nvec[1]),
                              rep(1, times = Nvec[2])))
      ## generate random IQ scores
      dat$IQ <- rnorm(sum(Nvec), m = Mvec[(dat$first + 1)], 
                       sd = SDvec[(dat$first + 1)])
      dat$IQ <- round(dat$IQ)
      attr(dat, "rep") <- rep
      attr(dat, "parms") <- c(N = N, M = M, SD = SD)
      dat
  }
\end{Sinput}
\end{Schunk}
