I am learning to work in statistics and I am currently working with a test data set that has baskets from around 200 persons that buy items from a imaginary store. They buy for example three units of milk the one day and the other day two units. I want to find out if the users in general tend to buy the same amount of items each time they are making a purchase over a period of time. Say if the customer buys milk do they always buy 3 units of milk or do they buy randomly distributed number of units of milk like (1 unit, 2 units, 1 unit, 5 units, ...). I will need to do that with every customer and every product group and conclude if in general customers buy the same amount of products for each purchase.

My idea was to calculate the average difference between all purchases like this:

(1-2) + (2-1) + (1-5)/4 (using the example above)

for each user and each product but that seems to me like it does not tells me anything important. Is there maybe a statistical and more correct approach to answer this question?

Thanks a lot in advance to the stack exchange community!


1 Answer 1


I think it would be better to calculate variance as this is a much more standard statistic. Additionally, if you know or assume that the data is distributed a certain way (eg. It comes from a Poisson distribution), you will be able to easily calculate confidence intervals. Variance also has nice mathematical properties. For example, it is additive, so Var(A) + Var(B) = Var(A+B).

The variance is the average squared difference of each value from the mean.

  • $\begingroup$ Thank you for your quick answer, Ryan. So I will have to calculate the variance for all combinations of customers and products (customer1 & product1, customer2 & product1, customer2 & product2...)? If I would have to then I could easily come to a lot of variances to check on as I have over 5000 products. Is it safe to combine all variances and make a conclusion that if variance is low, people tend always buy the same amount of products? So with Var(C1milk) + Var(C2milk) and then calculating the std? The problem is that there are customers that buy eg a lot of milk in general and others dont. $\endgroup$ Commented Jun 13, 2020 at 8:42
  • 1
    $\begingroup$ That seems correct. Using the average variance should be fine. Also, the fact that certain customes tend to buy more or less milk than others doesn't necessarily pose any problem. If one person buys 1,2, or 3 gallons of milk with equal probability, and another similarly buys 11, 12, or 13 gallons, they will have the same variance. Variance just measures the spread or dispersion of the data. Low variance indicates a person usually buys the same quantity of product, like you say. $\endgroup$
    – Ryan Volpi
    Commented Jun 14, 2020 at 2:52
  • $\begingroup$ Thanks for the explanation! It really helped me out a lot to find a solution on this problem. $\endgroup$ Commented Jun 14, 2020 at 14:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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