|
Think about the form of SSxx on the denominator of the beta_hat_1.
It is the sum of squared deviations from the sample mean; so,
if x=c(1,2,3,4,5), then by using the basic operators:
> SSxx<-sum((x-mean(x))^2)
> SSxx
[1] 10
As SSxy can be similarly obtained, we can find out the beta_hat_1.
For the beta_hat_0, just recall x_bar=mean(x), y_bar=mean(y).
Please let me know if it needs further clarification!
|