You did it by hand to understand it. In practice nobody computes Sxy with a calculator — R fits the whole model in one line, and hands back the exact same numbers.
Never used R? Set it up in 2 minutes →
lm stands for linear model. You give it a formula in the form response ~ predictor (read "y explained by x") and your data, and it returns the fitted model — slope, intercept and all.
That single lm() call does every step you ground out by hand: means, Sxx, Sxy, slope, intercept.
Every number you computed by hand is right there:
| In the output | Value | That's our… |
|---|---|---|
| (Intercept) | 400.73 | β̂₀ — intercept (Step 4) |
| hr | 1.639 | β̂₁ — slope (Step 4) |
| Residual standard error | 3.79 | s (Step 6) |
| Multiple R-squared | 0.9954 | R² (Step 7) |
lm(y ~ x, data = d) — fit the linesummary(fit) — coefficients, R², p-values, residual scoef(fit) — just β̂₀ and β̂₁predict(fit, newdata) — predict y for new x valuesconfint(fit) — 95% confidence intervals for the coefficientsplot(runs ~ hr, data = d); abline(fit) — scatter with the fitted lineRead the output below and answer. Type-and-check, same as before.

Two letters. It stands for "linear model".
lm() — linear model. The formula is response ~ predictor.

Form: response ~ predictor. The columns are runs and walks.
Response on the left of ~, predictor on the right. (y ~ x is the general form.)

It's the Estimate on the walks row.
Each extra walk allowed → ≈ 1.256 more runs allowed, on average.

Look for "Multiple R-squared".
Walks explain 99.8% of the variation in runs allowed.
By hand for understanding, in R for speed. That's the full toolkit for simple linear regression.