\begin{Schunk}
\begin{Sinput}
 plot(gradrate ~ instcstP1000, data = dat, subset = instcstP1000 < 25, pch = c("o","+")[schtype], col = schtype)
 m3byPrivate <- by(dat, dat$schtype, function(subdat){m1 <- lm(gradrate ~ instcstP1000, data = subdat)})
 abline(m3byPrivate[[1]], col = 1); abline(m3byPrivate[[2]], col = 2)
 legend("topleft", legend = levels(dat$schtype), col = c(1,2),  pch = c("o", "+"), lty=c(1,1))
\end{Sinput}
\end{Schunk}
