\begin{Schunk}
\begin{Sinput}
 m1 <- lm(y ~ xcat2n)
 plot.default(y ~ xcat2n, xlab = "One Categorical Predictor", ylab = "An Output Variable", xaxt = "n", xlim = c(-0.5, 1.5))
 axis(1, at = c(0, 1), labels = c("L=0","R=1"))
 p1 <- predict(m1, newdata = data.frame(xcat2n = c(0,1)))
 lines(c(-0.25, 0.25), c(p1[1], p1[1]), lwd = 2)
 lines(c(0.75, 1.25), c(p1[2], p1[2]), lwd = 2)
 legend("top", legend=c("OLS Predicted value"), lty = 1)
\end{Sinput}
\end{Schunk}
