In: Math
As a data scientist of a company, you want to analyze the following data collected by your company which relates the advertising expenditure A in thousands of dollars to total sales S in thousands of dollars. The following table shows this relationship
Advertising Expenditure (A) | Total Sales (S) |
18.6 | 312 |
18.8 | 322 |
18.8 | 333 |
18.8 | 317 |
19 | 301 |
19 | 320 |
19.2 | 305 |
Using Advertising expenditure (A) as the domain and Total Sales (S) as the range, the data is not a function because the value 18.8 and 19 appear in the domain more than once with a different corresponding value of the range each time.
--Interpret the slope and y-intercept of this equation.
--Express this equation as a function S of A and find its domain.
--Predict the sales if the advertising expenditure is $25000.
Solution:
intercept of the regression line can be calculated as
a = (summation(y) * summation(X^2) -
summation(x)*summation(xy))/n*summation(x^2)-(summation(x))^2
X |
Y |
XY |
X2 |
Y2 |
18.6 |
312 |
5803.2 |
345.96 |
97344 |
18.8 |
322 |
6053.6 |
353.44 |
103684 |
18.8 |
333 |
6260.4 |
353.44 |
110889 |
18.8 |
317 |
5959.6 |
353.44 |
100489 |
19 |
301 |
5719 |
361 |
90601 |
19 |
320 |
6080 |
361 |
102400 |
19.2 |
305 |
5856 |
368.64 |
93025 |
132.2 |
2210 |
41731.8 |
2496.92 |
698432 |
So a = (2210*2496.92)-(132.2*41731.8) /
(7*2496.92)-(132.2*132.2) = 780.775
Slope of the line can be calculated as
b = n*summation(XY) - summation(X)*summation(Y)/n*summation(X^2) -
(summation(x))^2
b = (7*41731.8) - (132.2*2210) / (7*2496.92)-(132.2*132.2) =
-24.625
So the equation is in terms of S and A as follows:
S = 780.775 -24.625*A
From the slope we can say that As advertising expenditure increase
by 1 unit than sales will decrease by 24.625unit. and intercept
tells that if Expenditure is 0 than sales would be 780.775
If Advertising expenditure = $25,000
than Sales. = 780.775 -24.625*25 = 780.775 - 615.625 = 165.15 or
$165000