Making predictions
To improve pricing decisions, the marketing manager needs to know how many volume sales can be expected under alternative unit prices. In particular, he wants to know the expected volume sales for the unit prices of 1.05 and 0.95?
You can use the coefficients from your previously fitted linear sales response model to make these predictions. The coef()
function returns a numeric coefficient vector with two elements: The first element is the sales intercept and the second element is the price slope of the linear.model
object. You calculate the expected sales by simply adding the price slope multiplied by 1.05 and 0.95 to the sales intercept.
This exercise is part of the course
Building Response Models in R
Exercise instructions
- Obtain the estimated coefficients from the
linear.model
object by using the functioncoef()
. Extract the sales intercept and the price slope coefficients individually by numeric indexing. - Calculate the expected volume sales for the unit prices 1.05 and 0.95.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Obtain the intercept coefficient
coef(linear.model)[___]
# Obtain the slope coefficient
coef(linear.model)[___]
# Calculate the volume sales for the unit price of 1.05
___(linear.model)[___] + ___ * ___(linear.model)[___]
# Calculate the volume sales for the unit price of 0.95
___(___)[___] + ___ * ___(___)[___]