# Fit regression model
lm.a = lm(coffee_sales ~ 1 + temperature, data = coffee)
# Print regression results
lm.a
Call:
lm(formula = coffee_sales ~ 1 + temperature, data = coffee)
Coefficients:
(Intercept) temperature
490.729 -5.343
EPSY 5261 : Introductory Statistical Methods
At the end of this lesson, you should be able to …
\[ \hat{y} = \underbrace{\beta_0}_{\text{Intercept}} + \underbrace{\beta_1}_{\text{Slope}}(x) \]
\[ \widehat{\text{Coffees}} = 491 - 5.3(\text{Temperature}) \]

Caution: We shouldn’t interpret an intercept if 0 is not within range of data (extrapolation).


Predict about how many coffee sales to expect on a 40 degree day:
\[ \begin{split} \hat{y} &= 491 - 5.3*(40)\\ &= 279 \end{split} \]
We predict 279 coffees will be sold on a 40°day, on average.

\[ \begin{split} &e = y - \hat{y}\\ &{\text{(in that order!)}} \end{split} \]
