We fit a linear model to estimate \(\beta_0\) and \(\beta_1\).
\[
\hat{y} = \hat{\beta_0} + \hat{\beta_1}x
\]
model <- lm(price ~ sqft, data = data)
summary(model)
##
## Call:
## lm(formula = price ~ sqft, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -30.168 -9.333 -1.229 9.988 32.395
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 51.413952 6.379256 8.06 1.79e-10 ***
## sqft 0.069601 0.002695 25.83 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 14.03 on 48 degrees of freedom
## Multiple R-squared: 0.9329, Adjusted R-squared: 0.9315
## F-statistic: 667.2 on 1 and 48 DF, p-value: < 2.2e-16