linear regression with averages