Ramin M. answered 05/04/20
Data Science Professional with Math and Coding Skills
So, it appears that the store manager has noticed a relationship between the temperature and sales of soft drinks. In particular, he believes that as the temperature increases, the sales increase as well. So, we can predict sales with temperature. That is, our response (Y) variable is sales and our predictor (X) variable is temperature. We would like to model the relationship between X and Y using the form Y = f(X) + error. (Response = Prediction + Error.) We only have a single predictor.
Let the intercept parameter be beta_0 and let our slope parameter be beta_1. Then, our linear model is
Y_i = beta_0 + beta_1 * x_i + some_error
Don't worry about the "some_error" term. You just need to calculate the beta_0 and beta_1 parameters using information below.
x_bar = avg(X)
y_bar = avg(Y)
beta_0 = y_bar - beta_1 * x_bar
beta_1 = [ SUM from 1 to n of ( (x_i - x_bar) * (y_i - y_bar) ) ] / [ SUM from 1 to n of (x_i - x_bar)^2 ]
Can you take it from here?