SSR vs SSE

y[ ]    are the observations
y_bar   is the mean of all y[ ]
y_hat[ ] are the y predicted by our model, ie, the fitted y



# Create x and some noise
  set.seed(1)
  x <- sample(2:30, 5)
  noise <- rnorm(x, 0, 0.1)   # note that we dont want a SD of 1, as that's too much noise relative to our synthetic values

# y is a  b + m*x + noiseFree
  y <- (3) + (2/3 * x) + (noise)
  # noiseFree <- (3) + (2/3 * x)


qplot(noiseFree, y) + meanline

meanline <- geom_hline( aes(yintercept = mean(y)), colour="#990000", linetype="dashed")


# round off for ease of chartting. The rounding can be considered part of the noise. 
  y <- round(y, 2)

  y


qplot(x, y)

model <- lm(y~x)
summary(model)

i <- seq_along(y)


# Let's create a table
i,  y,  y_bar, y_hat, 
