Reading the Data

getwd()
## [1] "D:/Umang/IIM Lucknow/Acads/Sem 5/DAM/10 - 27.10.2018"
sales=read.csv("PricePromoData.csv")
  1. Price Elasticity of X
m1=lm(log(sales$oz_X)~log(sales$pX))
summary(m1)
## 
## Call:
## lm(formula = log(sales$oz_X) ~ log(sales$pX))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.6564 -0.2395 -0.0788  0.1190  1.2732 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   -16.5304     0.3840  -43.05   <2e-16 ***
## log(sales$pX)  -6.9446     0.1074  -64.63   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.3671 on 726 degrees of freedom
## Multiple R-squared:  0.8519, Adjusted R-squared:  0.8517 
## F-statistic:  4177 on 1 and 726 DF,  p-value: < 2.2e-16

For every 1% increase in price, the sales will reduce by 6.94%.

  1. Price Elasticity of Y
m2=lm(log(sales$oz_Y)~log(sales$pY))
summary(m2)
## 
## Call:
## lm(formula = log(sales$oz_Y) ~ log(sales$pY))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.9059 -0.6063  0.0550  0.6057  3.4900 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   -15.5981     0.8990  -17.35   <2e-16 ***
## log(sales$pY)  -6.6942     0.2519  -26.57   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9671 on 726 degrees of freedom
## Multiple R-squared:  0.4931, Adjusted R-squared:  0.4924 
## F-statistic: 706.1 on 1 and 726 DF,  p-value: < 2.2e-16
  1. Comparing the elasticities of x and Y

The price elasticity of Coke is higher than Pepsi. So, if I wanted to give a discount of $1 on Coke or Pepsi, taking prices equal, the volume of Coke will increase more.

  1. Cross Price Elasticity of X wrt Y
m3=lm(log(sales$oz_X)~log(sales$pY))
summary(m3)
## 
## Call:
## lm(formula = log(sales$oz_X) ~ log(sales$pY))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.3777 -0.5510 -0.4059 -0.1456  2.5414 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)     9.4395     0.8857  10.658   <2e-16 ***
## log(sales$pY)   0.3268     0.2482   1.317    0.188    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.9528 on 726 degrees of freedom
## Multiple R-squared:  0.002383,   Adjusted R-squared:  0.001008 
## F-statistic: 1.734 on 1 and 726 DF,  p-value: 0.1883
  1. Cross Price Elasticity of Y wrt X
m4=lm(log(sales$oz_Y)~log(sales$pX))
summary(m4)
## 
## Call:
## lm(formula = log(sales$oz_Y) ~ log(sales$pX))
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -3.3541 -0.9954 -0.0906  0.9914  3.6652 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    11.1712     1.4169   7.884 1.16e-14 ***
## log(sales$pX)   0.8120     0.3965   2.048   0.0409 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.354 on 726 degrees of freedom
## Multiple R-squared:  0.005745,   Adjusted R-squared:  0.004376 
## F-statistic: 4.195 on 1 and 726 DF,  p-value: 0.0409
  1. Are they the same? Or different? What do you infer?

The cross price elasticity of Y wrt X is more than that of X wrt Y. That means, if I increase the price of X, there would be a greater increase in demand of Y than the increase in demand of X by increasing Y’s price.

  1. Price Elasticity of X when deal is offered and when it isn’t
sales$DX= factor(sales$deal_X, levels = c("Yes","No"), labels = cbind("1","0"))
m5=lm(log(sales$oz_X)~log(sales$pX)+sales$DX+log(sales$pX)*sales$DX)
summary(m5)
## 
## Call:
## lm(formula = log(sales$oz_X) ~ log(sales$pX) + sales$DX + log(sales$pX) * 
##     sales$DX)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.47804 -0.11484 -0.01953  0.06748  1.28798 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)    
## (Intercept)              -6.3626     1.2464  -5.105 4.24e-07 ***
## log(sales$pX)            -4.3388     0.3288 -13.195  < 2e-16 ***
## sales$DX0                 3.9397     1.3448   2.930   0.0035 ** 
## log(sales$pX):sales$DX0   1.4255     0.3588   3.973 7.80e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2288 on 724 degrees of freedom
## Multiple R-squared:  0.9426, Adjusted R-squared:  0.9424 
## F-statistic:  3966 on 3 and 724 DF,  p-value: < 2.2e-16
m7=lm(log(sales$oz_X)~log(sales$pX)+sales$deal_X+log(sales$pX)*sales$deal_X)
summary(m7)
## 
## Call:
## lm(formula = log(sales$oz_X) ~ log(sales$pX) + sales$deal_X + 
##     log(sales$pX) * sales$deal_X)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.47804 -0.11484 -0.01953  0.06748  1.28798 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    -2.4229     0.5048  -4.800 1.93e-06 ***
## log(sales$pX)                  -2.9133     0.1435 -20.302  < 2e-16 ***
## sales$deal_XYes                -3.9397     1.3448  -2.930   0.0035 ** 
## log(sales$pX):sales$deal_XYes  -1.4255     0.3588  -3.973 7.80e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2288 on 724 degrees of freedom
## Multiple R-squared:  0.9426, Adjusted R-squared:  0.9424 
## F-statistic:  3966 on 3 and 724 DF,  p-value: < 2.2e-16
  1. Is the price elasticity of X when a deal is offered different than the price elasticity when a deal is not offered?

When we use the numerical values for deal(0 & 1), the regression is showing unexpected results, as for the interaction term, we expected to see the results for when the deal is active, that is, DX=1, but instead it’s showing for DX=0. So we can’t really say anything. However, when we use the deal_X directly, we see that the price elasticity in absence of promo is higher than in the presence of promo. This means that the change in price will lead to a higher change in volume when the promotions aren’t active. So this leads us to the conclusion that we should increase the prices when promotions are active.

  1. Price Elasticity of Y when deal is offered and when it isn’t
sales$DY= factor(sales$deal_Y, levels = c("Yes","No"), labels = cbind("1","0"))
m6=lm(log(sales$oz_Y)~log(sales$pY)+sales$DY+log(sales$pY)*sales$DY)
summary(m6)
## 
## Call:
## lm(formula = log(sales$oz_Y) ~ log(sales$pY) + sales$DY + log(sales$pY) * 
##     sales$DY)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.83238 -0.61046  0.02982  0.60163  3.06752 
## 
## Coefficients:
##                         Estimate Std. Error t value Pr(>|t|)   
## (Intercept)              -10.543      6.541  -1.612  0.10744   
## log(sales$pY)             -5.444      1.715  -3.175  0.00156 **
## sales$DY0                  7.000      6.767   1.034  0.30125   
## log(sales$pY):sales$DY0    2.208      1.785   1.238  0.21629   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.927 on 724 degrees of freedom
## Multiple R-squared:  0.5355, Adjusted R-squared:  0.5335 
## F-statistic: 278.2 on 3 and 724 DF,  p-value: < 2.2e-16
m8=lm(log(sales$oz_Y)~log(sales$pY)+sales$deal_Y+log(sales$pY)*sales$deal_Y)
summary(m8)
## 
## Call:
## lm(formula = log(sales$oz_Y) ~ log(sales$pY) + sales$deal_Y + 
##     log(sales$pY) * sales$deal_Y)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -2.83238 -0.61046  0.02982  0.60163  3.06752 
## 
## Coefficients:
##                               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)                    -3.5422     1.7345  -2.042   0.0415 *  
## log(sales$pY)                  -3.2352     0.4947  -6.539 1.17e-10 ***
## sales$deal_YYes                -7.0003     6.7669  -1.034   0.3013    
## log(sales$pY):sales$deal_YYes  -2.2084     1.7845  -1.238   0.2163    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.927 on 724 degrees of freedom
## Multiple R-squared:  0.5355, Adjusted R-squared:  0.5335 
## F-statistic: 278.2 on 3 and 724 DF,  p-value: < 2.2e-16
  1. Is the price elasticity of Y when a deal is offered different than the price elasticity when a deal is not offered?

When we use the numerical values for deal(0 & 1), the regression is showing unexpected results, as for the interaction term, we expected to see the results for when the deal is active, that is, DY=1, but instead it’s showing for DY=0. So we can’t really say anything. However, when we use the deal_X directly, we see that the price elasticity in absence of promo is higher than in the presence of promo. This means that the change in price will lead to a higher change in volume when the promotions aren’t active. So this leads us to the conclusion that we should increase the prices when promotions are active.