Get startedGet started for free

Price elasticity

1. Price elasticity

Up until now we have only used time series to forecast demand for a product. Are previous values of sales the only thing influencing demand? When trying to predict demand for products there many factors that influence demand. Price is one of the obvious ones. How price effects demand is referred to as price elasticity.

2. Price vs. Demand

It is not hard to understand why prices are related to demand of products. If suddenly your favorite brand of bread tripled in price, you would probably reconsider buying it. Price elasticity is the economic measure of how much demand changes or "reacts" to changes in price.

3. Elastic vs. Inelastic

How much demand changes with changes in prices determines whether a product is called elastic or inelastic. Elastic goods are ones where demand changes are larger than price changes in terms of percentages. For example, bread. You probably would stop buying a certain brand of bread if that brand tripled its price while other brands stayed the same. Inelastic goods are the opposite. Even large changes in prices don't make inelastic goods change too drastically in demand. Gasoline is one example of this. Rarely, will you stop buying gasoline just because the prices increased. Unit elastic goods are ones where the change is the same. For example, if bread increased price by 10% and demand also dropped 10% in response.

4. Linear Regression

How can we estimate price elasticities for our products? Typically we can use linear regression to estimate this relationship between price and demand. Without going into too much detail, linear regression estimates the linear relationship between two factors. Imagine I had a product with many different prices I charged for it along with the respective sales at those prices in a scatterplot. For more details on linear regression, Datacamp has some amazing courses on the subject!

5. Linear Regression

Linear regression fits a line through this plot to estimate the relationship between the two factors. This line minimizes the squared distance between all the points and the line. From here we have an estimate of price elasticity!

6. Price Elasticity Example

Let's build our regression! First we need our sales saved as M_hi and our prices saved as M_hi_p. We make them into vectors to deal with them outside of time series approaches. Next we create a data frame to store these variables which will help us later when we add more! When we build the regression we actually use the natural log of price to predict the natural log of sales. Why do we do this? This actually transforms the coefficient given by the regression from units of demand to percentage change in demand given a percentage change in price. Let's take a look at the coefficient on the log of price, which is -0.7138. If we take the absolute value of this we get a number between 0 and 1. That means our hi end product is inelastic in the mountain region. Looks like changes in prices here will not drastically change the demand. That good news for us!

7. Let's practice!

I wonder if the products in the metropolitan region are similar in their relationship to price as the mountain ones we just calculated. Time for you to find out!