Questions: The following data represent the speed at which a ball was hit (in miles per hour) and the distance it traveled (in feet) for a random sample of home runs in Major League baseball games in the 2021 season. Complete parts (a) through (f).
(a) Find the least-squares regression line treating speed at which the ball was hit as the explanatory variable and distance the ball traveled as the response variable.
ŷ = 3.482x + (-26.1)
(Round to three decimal places as needed.)
Data Table
Distance (feet), Speed (mph)
354, 97.6
368, 100.6
410, 101.3
364, 102.2
402, 103.7
389, 104.3
415, 104.9
413, 106.3
417, 107.5
397, 108.2
378, 110.2
426, 114.1
Transcript text: The following data represent the speed at which a ball was hit (in miles per hour) and the distance it traveled (in feet) for a random sample of home runs in Major League baseball games in the 2021 season. Complete parts (a) through (f).
(a) Find the least-squares regression line treating speed at which the ball was hit as the explanatory variable and distance the ball traveled as the response variable.
$\hat{y} = 3.482x + (-26.1)$
(Round to three decimal places as needed.)
Data Table
Distance (feet), Speed (mph)
354, 97.6
368, 100.6
410, 101.3
364, 102.2
402, 103.7
389, 104.3
415, 104.9
413, 106.3
417, 107.5
397, 108.2
378, 110.2
426, 114.1
Solution
Solution Steps
To find the least-squares regression line, we need to calculate the slope and intercept of the line that best fits the given data points. The formula for the least-squares regression line is $\hat{y} = b_0 + b_1x$, where $b_0$ is the y-intercept and $b_1$ is the slope. We can use Python's numpy library to perform these calculations.
Step 1: Data Representation
We are given the following data representing the distance (in feet) a ball traveled and the speed (in miles per hour) at which it was hit: