• iid
  • Dependent variable (response, regressand)
  • Independent variable , (explanatory variable, regressor)
  • is slope
  • is the y-intercept
  • is an rv, for this course is not random

Least Square

  • Find the straight line such that the total deviations from the sample points is the smallest

We use square because we want to use derivative to find the minimum

# By hand
dx = x-mean(x)
dy = y-mean(y)
 
sxy = sum(dx*dy)
sxx = sum(dx^2)
 
beta1 = sxy/sxx
beta0 = mean(y) - beta1*mean(x)
 
plot(x, y, xlab="Father's height", ylab="Son's height")
abline(a = beta0,b=beta1, col=“red")
# By function (y depends on x)
lm(y~x)

Estimators

and are unbiased estimator

CI

  • known sigma^2
    • for beta1
  • unknown sigma

Decomposition of Variance