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([051015202530]) 
    Y = np.array([60083665337009976784840778730294071]) 
 
    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:

c : [ 0 , + ) [ 0 , + ) , c ( t ) = 1124 . 86 x + 60119 . 9 .

The regression line then looks as follows:

(c)
We should find the values c ( 17 ) and c ( 32 ) using the graph in (b):

As we can see from the graph, c ( 17 ) 79 , 000 thousands of barrels per day and c ( 32 ) 96 , 000 thousands of barrels per day.

User profile picture
2023-08-08 06:45
Comments