Statistics 2

In-Class Exercise 7

Yu-You Liou

Shih Chien University

2026-09-16

Data for Questions 1 to 3

Use the advertising and sales data from Exercise 6.

ads   <- c(2.1, 3.4, 1.8, 4.2, 2.9, 5.1, 3.7, 1.5, 4.6, 2.5)
sales <- c(18.2, 22.6, 17.1, 29.5, 20.4, 31.8, 27.9, 15.3, 28.6, 21.7)

Question 1

Fitting the Regression Line

  1. Fit the model with model <- lm(sales ~ ads).
  2. Report the intercept a and the slope b with coef().
  3. Write the regression equation in the form y'=a+bx, rounding each coefficient to two decimal places.

Question 2

Interpreting the Slope

  1. Interpret the slope in the context of this problem, using the units of the two variables.
  2. Interpret the intercept, and state whether that interpretation is meaningful here.

Question 3

Prediction

  1. Predict sales when advertising expenditure is 3.0, using predict() with a new data.frame().
  2. Predict sales when advertising expenditure is 12.0.
  3. Explain in one or two sentences why the second prediction should not be trusted.