\begin{Schunk}
\begin{Sinput}
 dat <- genCorrelatedData2(1000, means=c(10, 10, 10), sds = 3, stde = 3, beta = c(1, 1, -1, 0.5))
\end{Sinput}
\begin{Soutput}
[1] "The equation that was calculated was"
y = 1 + 1*x1 + -1*x2 + 0.5*x3 
 + 0*x1*x1 + 0*x2*x1 + 0*x3*x1 
 + 0*x1*x2 + 0*x2*x2 + 0*x3*x2 
 + 0*x1*x3 + 0*x2*x3 + 0*x3*x3 
 + N(0,3) random error 
\end{Soutput}
\begin{Sinput}
 dat$xcat1 <- factor(sample(c("a", "b", "c", "d"), 1000, replace=TRUE))
 dat$xcat2 <- factor(sample(c("M", "F"), 1000, replace=TRUE), levels = c("M", "F"), labels = "Male", "Female")
 dat$y <- dat$y + contrasts(dat$xcat1)[dat$xcat1, ] %*% c(0.1, 0.2, 0.3)
 m4 <- lm(y ~ x1 + x2  + x3 + xcat1 + xcat2, dat)
\end{Sinput}
\end{Schunk}
