\begin{Schunk}
\begin{Sinput}
 N <- 300
 x <- rnorm(N)
 xcat2 <- cut(x, breaks=c(-Inf, 0.5, Inf), labels=c("L", "R"))
 xcat2c <- contrasts(xcat2)[xcat2, ]	
 xcat2n <- as.numeric(xcat2)-1
 ycatn <- ifelse(x < x + rnorm(N), 0, 1)
 plot.default(ycatn ~ xcat2n, xlim=c(-0.5, 1.5), ylim = c(-0.5, 1.5), xlab = "One Categorical Predictor", ylab="An Output Variable", axes = F, bty="L")
 axis(1, at = c(0, 1), labels = c("L","R"))
 axis(2, at = c(0, 1), labels = c("L", "H"))
\end{Sinput}
\end{Schunk}
