\begin{Schunk}
\begin{Sinput}
 plot(sei ~ educ, data = dat,  main = "", xlab = "Education (years)", 
      ylab = "Socio-economic Status", ylim = c(0,120), type = "n")
 sexcolor <- ifelse(dat$sex == "MALE", "black", "gray60")
 sexpch <- ifelse(dat$sex == "MALE", 1, 4)
 points(sei ~ educ, data = dat, cex = 0.5, lwd = 0.2, 
      col = sexcolor, pch = sexpch)
 legend("topleft", legend = c("Male","Female"), 
      col = c("black","gray80"), pch = c(1,4))
\end{Sinput}
\end{Schunk}
