# Fit the linear regression model
model <- lm(sales ~ advertising, data = data)
# Display summary
summary(model)
##
## Call:
## lm(formula = sales ~ advertising, data = data)
##
## Residuals:
## Min 1Q Median 3Q Max
## -18.0462 -4.4629 -0.5254 4.3941 17.4890
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 18.52185 2.53874 7.296 2.59e-09 ***
## advertising 0.73393 0.04058 18.088 < 2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 7.523 on 48 degrees of freedom
## Multiple R-squared: 0.8721, Adjusted R-squared: 0.8694
## F-statistic: 327.2 on 1 and 48 DF, p-value: < 2.2e-16