Homepage › Solution manuals › James Stewart › Calculus: Early Transcendentals › Exercise 1.2.33
Exercise 1.2.33
The table shows world average daily oil consumption from 1985 to 2015, measured in thousands of barrels per day.
- (a)
- Make a scatter plot and decide whether a linear model is appropriate.
- (b)
- Find and graph the regression line.
- (c)
- Use the linear model to estimate the oil consumption in 2002 and 2017.
Answers
- (a)
-
We make the scatter plot as follows:
As we can see, the linear model is appropriate for this graph.
- (b)
-
Using Python, we calculate the regression function
import numpy as np X = np.array([0, 5, 10, 15, 20, 25, 30]) Y = np.array([60083, 66533, 70099, 76784, 84077, 87302, 94071]) result = np.polyfit(X, Y, 1) # 1 indicates linear regression slope = result[0] intercept = result[1] print("Slope (m):", slope) print("Intercept (b):", intercept)
(Alternatively, we can use WolframAlpha). In other words, we get the regression formula:
The regression line then looks as follows:
- (c)
-
We should find the values
and
using the graph in (b):
As we can see from the graph, thousands of barrels per day and thousands of barrels per day.