Om Joy Halder
25-11-2017
ecom<- read.csv(paste("PromotionDataV4.csv", sep= " "))
Has_COD = subset(ecom, ecom$COD == 1 )
Not_COD = subset(ecom, ecom$COD == 0)
# Average price paid with COD
mean(Has_COD$FinalTotalPrice)
[1] 774.6938
# Average price paid without COD
mean(Not_COD$FinalTotalPrice)
[1] 723.248
Call:
lm(formula = ecom$FinalTotalPrice ~ ecom$COD, data = ecom)
Residuals:
Min 1Q Median 3Q Max
-774.7 -208.7 -94.3 143.0 6203.3
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 723.248 2.572 281.19 <2e-16 ***
ecom$COD 51.446 3.285 15.66 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 342.7 on 45896 degrees of freedom
Multiple R-squared: 0.005317, Adjusted R-squared: 0.005295
F-statistic: 245.3 on 1 and 45896 DF, p-value: < 2.2e-16
Here, we see there is a significant relation between payment method and total price as the p value is less than 0.05. As stated in the data description payment through COD comes with an extra charge, this regression corroborates that that mode of payment influence the final price.
# Units sold
nrow(Has_COD)
[1] 28144
nrow(Not_COD)
[1] 17754
# Total Revenue
mytable <- aggregate(ecom$FinalTotalPrice ~ ecom$COD, FUN = sum)
mytable
ecom$COD ecom$FinalTotalPrice
1 0 12840545
2 1 21802982
Here, we see that more number of units have been sold through COD than through elctronic payment. Consequently, more revenue has been accrued through cash payment. So, we can presume that COD is more popular method of payment.