MatCyt / Price_Elasticity

Calculating regular and cross price elasticity for products based on weekly sales data
25 stars 19 forks source link

Cross price elasticity calculation question. #1

Open dragutcl opened 4 months ago

dragutcl commented 4 months ago

In the cross_price_elasticity.R file, in the line with comment "keep sales of sku as target and price of all other skus as other variables", the code following is not excluding the sku in the current loop but instead includes all the skus rather than all other skus.

input = df_casted %>% # keep sales of sku as target and price of all other skus as other variables select(str_subset(names(df_casted), 'average_price'), target_variable)

If own elasticity is needed, then comment should be corrected to reflect the logic.

MatCyt commented 4 months ago

Hey, Thanks a lot for finding the time to open an issue here. I'm really happy that people still seem to stumble apon the repo I've created few years back. That said it's been a long time since I've last used R or worked on similar set of problems. If there is an issue you'd like to fix I'm happy to take a pull request to fix it.