LoslegenKostenlos loslegen

A linear response model for sales

In the past, the brewery ran several price promotion campaigns that are causing price levels to vary. Now, the marketing manager wants to know to what extent these price changes influenced sales.

You start explaining the effect of changes in PRICE to changes in SALES by using the linear model function lm(). The lm() function requires the specification of the sales - price relation via the formula argument SALES ~ PRICE. The estimated coefficients for the linear sales response model can be obtained by using the function coef().

Diese Übung ist Teil des Kurses

Building Response Models in R

Kurs anzeigen

Anleitung zur Übung

  • Explain SALES by PRICE. Use the function lm() and assign the result to an object called linear.model.
  • Obtain the model coefficients of the linear.model object by using the function coef().

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Explain SALES by PRICE
linear.model <- ___(___ ~ ___, data = sales.data)

# Obtain the model coefficients
Code bearbeiten und ausführen