rm(list = ls()) cnt=c(34,31,19,23,61,19,23,39,16,17,16,12) pa=c(1,1,1,1,2,2,2,2,3,3,3,3) clg=c(1,2,3,4,1,2,3,4,1,2,3,4) LGCNT=matrix(log(cnt),nrow=4) LGCNT test=c(1,2,3) par(mfrow=c(1,1)) plot(test,LGCNT[1,],type="n",ylab="log(n)",ylim=c(2.5,4.25), xaxt="n",xlab="Political Affiliation",lty=1,lwd=2) axis(1,at=c(1,2,3),labels=c("Rep.","Dem.","Ind.")) lines(test,LGCNT[1,],type="o",lty=1,lwd=2) lines(test,LGCNT[2,],type="o",lty=2,lwd=2) lines(test,LGCNT[3,],type="o",lty=3,lwd=2) lines(test,LGCNT[4,],type="o",lty=4,lwd=2) legend("topright",c("College","Letters", "Engin.","Agri.","Educ."),lty=c(NA,1,2,3,4))