data(Draft1970)
# scatterplot
plot(Rank ~ Day, data=Draft1970)
with(Draft1970, lines(lowess(Day, Rank), col="red", lwd=2))
abline(lm(Rank ~ Day, data=Draft1970), col="blue")
# boxplots
plot(Rank ~ Month, data=Draft1970, col="bisque")
lm(Rank ~ Month, data=Draft1970)
anova(lm(Rank ~ Month, data=Draft1970))
# make the table version
Draft1970$Risk <- cut(Draft1970$Rank, breaks=3, labels=c("High", "Med", "Low"))
with(Draft1970, table(Month, Risk))
Run the code above in your browser using DataLab