See the introduction for an overview. Also see other analyses of this data. See the textbook for a full discussion.

Load the libraries:

library(ggplot2)
library(rstan)
library(reshape2)
library(dplyr)

Data

Load in and plot the data:

data(jsp, package="faraway")
jspr <- jsp[jsp$year==2,]
jspr$craven <- jspr$raven-mean(jspr$raven)
ggplot(jspr, aes(x=raven, y=math))+xlab("Raven Score")+ylab("Math Score")+geom_point(position = position_jitter())