I have sales by customer (b2b) and by date. I want to check if the distribution per day inside weeks remains the same from week to week.

Initial dataset

Customer Date Sales
Alpha 2019-02-23 527
Beta 2019-02-23 642
Alpha 2019-02-24 776
... ... ...
Beta 2021-07-28 1236

I transformed it into

Customer Week Monday Tuesday Wednesday Thursday Friday Saturday Sunday
Alpha 201906 0.2202 0.15799 0.178202 0.160449 0.1528 0.130214 0.000067
Beta 201906 0.20573 0.183979 0.182207 0.179824 0.140596 0.107601 0.000061
... ... ... ... ... ... ... ... ...
Beta 202130 0.219794 0.181995 0.172113 0.156676 0.151771 0.117579 0.000072

Any ideas on how to tackle this?

  • $\begingroup$ have a look at ANOVA tests. i think they allow for comparing multiple categories. you can also just plot them on the same chart using the human brain for unsupervised learning! $\endgroup$
    – Kalanos
    Jul 29 at 21:26
  • $\begingroup$ Hi, problem related to statistics should be asked on stats.stackexchange.com for more/better clarification. $\endgroup$
    – Ankit Seth
    Aug 29 at 16:53

You can create n matrices where n is the number of different products {Alpha, Beta, ...,} then for each different product you group your daily value into weekly so you have something like Product1 : {week_1_sales,...,week_M_sales} with those values you create a confusion squared matrix of dimension MxM with rows and columns week_i_sales and values are the KS statistic (pairwise) so you can see if the distribution of the weekly sales for product changes from one week to another.

You would end with n different matrices with this information. Each individual matrix should look similar to this (just and example in your case rows and columns would be the week id):

enter image description here

  • $\begingroup$ What I am interested in is to check if the daily distribution (Monday to Sunday) remains the same for all weeks. $\endgroup$
    – Ismail
    Jul 29 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.