We built a linear regression model using
fit <- lm(dist ~ speed, data = cars)
We get the following output
| Estimate | Std. Error | t value | Pr(>|t|) | |
|---|---|---|---|---|
| (Intercept) | -17.579 | 6.758 | -2.601 | 0.012 |
| speed | 3.932 | 0.416 | 9.464 | 0.000 |
Note that the slope of the regression is 3.9324088.
The model fitted values (fitted.values) and residuals (fit$residuals) are
## Loading required package: DT